Software Desugn Lecture 5b. Supplementary
Software Desugn Lecture 5b. Supplementary
data structures.
▪ They do not help much with the early, creative phase of design. Rather, they
help the designer to structure and document his or her design
ideas.
DESIGN DESCRIPTION
Graphical notations: Used to display component relationships.
▪ Object-oriented design
The system is viewed as a collection of interacting objects.
The system state is decentralized and each object manages its own state.
Objects may be instances of an object class and communicate by exchanging methods.
FUNCTIONAL VIEW OF A
COMPILER
OBJECT-ORIENTED VIEW OF A
COMPILER
MIXED-STRATEGY DESIGN
▪Although it is sometimes suggested that one approach to design is superior, in
practice, an object-oriented and a functional-oriented approach to design are
complementary.
▪Good software engineers should select the most appropriate approach for
whatever sub-system is being designed.
DESIGN QUALITY
▪ Design quality is an elusive concept. Quality depends on specific
organizational priorities.
▪ A “good” design may be the most efficient, the cheapest, the most
maintainable, the most reliable, etc.
▪ The attributes discussed here are concerned with the maintainability of the
design.
All the elements of a component operate on the same input or produce the same output.
The output for one part of a component is the input to another part.
Each operation provides functionality which allows object attributes to be modified or inspected.
COHESION AS A DESIGN
ATTRIBUTE
▪Inheriting attributes from super-classes weakens cohesion.
Coupling
A measure of the strength of the inter-connections between system components.
ATTRIBUTE: COUPLING
▪Loose coupling means component changes are unlikely to affect other components.
28
TIGHT COUPLING
LOOSE COUPLING
COUPLING AND INHERITANCE
▪Object-oriented systems are loosely coupled because there is no shared state
32
ATTRIBUTE: ADAPTABILITY
A design is adaptable if:
Its components are loosely coupled.
To adapt a design, it must be possible to trace the links between design components
so that change consequences can be analyzed.
33
DESIGN TRACEABILITY
ADAPTABILITY AND INHERITANCE
35
ARCHITECTURAL DESIGN
Establishing the overall structure of
a software system
ARCHITECTURAL PARALLELS
▪Architects are the technical interface between the customer and the contractor
▪However, most systems are heterogeneous in that different parts of the system
are based on different models and, in some cases, the system may follow a
composite model.
▪More specific models showing how sub-systems share data, are distributed and
When large amounts of data are to be shared, the repository model of sharing
is most commonly used.
CASE TOOL SET
ARCHITECTURE
REPOSITORY MODEL
CHARACTERISTICS
Advantages:
Efficient way to share large amounts of data.
Sub-systems need not be concerned with how data is produced.
Centralized management e.g., backup, security, etc.
Sharing model is published as the repository schema.
Disadvantages:
Sub-systems must agree on a repository data model.
Data evolution is difficult and expensive.
No scope for specific management policies.
Difficult to distribute efficiently.
CLIENT-SERVER
ARCHITECTURE
▪Distributed system model which shows how data and processing is distributed
▪Set of stand-alone servers which provide specific services such as printing, data
management, etc.
Disadvantages:
No shared data model so sub-systems may use different data organizations.
Redundant management in each server.
No central register of names and services - it may be hard to find out what servers and services are available.
OBJECT MODELS
▪Structure the system into a set of loosely coupled objects with well-defined
interfaces.
▪When implemented, objects are created from these classes and some control
▪Organizes the system into a set of layers (or abstract machines) each
of which provide a set of services.
▪Variants of this approach are very common. When transformations are sequential, this is
a batch sequential model which is extensively used in data processing systems.
▪ Reference models which are more abstract, idealized model. Provide a means of information about that class
of system and of comparing different architectures.
▪ Symbol table
▪ Syntax analyzer
▪ Syntax tree
▪ Semantic analyzer
▪ Code generator
communication systems.
OSI REFERENCE MODEL
DISTRIBUTED SYSTEMS
ARCHITECTURES
computer or workstation.
▪Distributed systems where the system software runs on a loosely integrated group of
▪Resource sharing
▪Openness
▪Concurrency
▪Scalability
▪Fault tolerance
▪Transparency
DISTRIBUTED SYSTEM DISADVANTAGES
▪Complexity
▪Security
▪Manageability
▪Unpredictability
ISSUES IN DISTRIBUTED SYSTEM DESIGN
DISTRIBUTED SYSTEMS
ARCHIECTURES
Client-server architectures
Distributed services which are called on by clients. Servers that provide services are treated
No distinction between clients and servers. Any object on the system may provide and use services
▪Software that manages and supports the different components of a distributed system.
Examples
▪ Data converters
▪ Communication controllers
MULTIPROCESSOR
ARCHITECTURES
▪Simplest distributed system model
▪System composed of multiple processes which may (but need not) execute on
different processors
Concerned with presenting the results of a computation to system users and with collecting user inputs
Concerned with providing application specific functionality e.g., in a banking system, banking functions such as
Fat-client model
In this model, the server is only responsible for data management. The software on the client implements
the application logic and the interactions with the system user.
THIN AND FAT CLIENTS
THIN CLIENT MODEL
Used when legacy systems are migrated to client server architectures.
The legacy system acts as a server in its own right with a graphical interface implemented on a
client
executed
▪Most suitable for new C/S systems where the capabilities of the client system are known
in advance
▪More complex than a thin client model especially for management. New versions of the
▪Each distributable entity is an object that provides services to other objects and
receives services from other objects
▪It allows the system designer to delay decisions on where and how services should be provided
▪It is a very open system architecture that allows new resources to be added to it as required
▪It is possible to reconfigure the system dynamically with objects migrating across the network as
required
USES OF DISTRIBUTED OBJECT
ARCHITECTURE
▪As a logical model that allows you to structure and organise the system. In this case, you
think about how to provide application functionality solely in terms of services and
combinations of services
▪As a flexible approach to the implementation of client-server systems. The logical model of
the system is a client-server model but both clients and servers are realised as distributed
▪It allows the number of databases that are accessed to be increased without disrupting
the system
▪It allows new types of relationship to be mined by adding new integrator objects
CORBA
▪CORBA is an international standard for an Object Request Broker - middleware to
▪Standard objects, defined by the OMG, for a specific domain e.g. insurance
facilities
CORBA APPLICATION STRUCTURE
CORBA STANDARDS
▪An object model for application objects
▪ A CORBA object is an encapsulation of state with a well-defined, language-neutral interface defined in an IDL
▪An object request broker that manages requests for object services
▪They MUST have a separate interface definition that is expressed using a common
language (IDL) similar to C++
▪There is a mapping from this IDL to programming languages (C++, Java, etc.)
▪Therefore, objects written in different languages can communicate with each other
OBJECT REQUEST BROKER
(ORB)
The ORB handles object communications. It knows of all objects in the system
and their interfaces
Using an ORB, the calling object binds an IDL stub that defines the interface of
the called object
Calling this stub results in calls to the ORB which then calls the required object
through a published IDL skeleton that links the interface to the service
implementation
ORB-BASED OBJECT COMMUNICATIONS
INTER-ORB COMMUNICATIONS
▪ These allow objects to discover and refer to other objects on the network
▪Notification services
▪ These allow objects to notify other objects that an event has occurred
▪Transaction services
# Initiate the hello server (relies on the name server being on king's 1050 port.)
java HelloServer -ORBInitialPort 1050 -ORBInitialHost king.mcs.drexel.edu
# Initiate the hello client (relies on the name server being on king's 1050 port.)
java HelloClient -ORBInitialPort 1050 -ORBInitialHost king.mcs.drexel.edu
“HELLO WORLD” IDL SPECIFICATION
module HelloApp
{
interface Hello
{
string sayHello();
};
};
“HELLO WORLD” CLIENT
JAVA PROGRAM
import HelloApp.*;
import org.omg.CosNaming.*; // package used for name service
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
} catch (Exception e) {
System.out.println("ERROR : " + e) ;
e.printStackTrace(System.out);
}
}
}
“HELLO WORLD” SERVER
JAVA PROGRAM
import HelloApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
} catch (Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
}
}