System Design - ehelp.yolasite.comehelp.yolasite.com/resources/Unit 3.docx  · Web viewThe UML has...

15
System Design 1 SYSTEM DESIGN System design is the process of defining the architecture, components, modules, interfaces and data for a system to satisfy specified requirements. Object-oriented analysis and design methods are becoming the most widely used methods for computer system design. The UML has become the standard language in object-oriented analysis and design. System design is the high-level strategy for solving the problem and building a solution. During analysis, the focus is on what needs to be done, independent of how it is done. During design, decisions are made about how the problem will be solved, first at high level, then at increasingly detailed levels. It is the first design stage in which the basic approach to solving the problem is selected. During system design, the overall structure and style are decided. The purpose of design phase is to plan a solution of the problem. Starting with what is needed design takes us toward how to satisfy the needs. It is a most critical factor which affects the quality of the system. The design activity results in 3 separate outputs: o Architecture design o High level design o Detailed design o Architecture focus on identifying components and how they connect. o High level design focuses on identifying the modules. o Detailed design focuses on designing the logic for each of the modules. OOAD

Transcript of System Design - ehelp.yolasite.comehelp.yolasite.com/resources/Unit 3.docx  · Web viewThe UML has...

System Design 1

SYSTEM DESIGN System design is the process of defining the architecture, components, modules,

interfaces and data for a system to satisfy specified requirements. Object-oriented analysis and design methods are becoming the most widely used

methods for computer system design. The UML has become the standard language in object-oriented analysis and design.

System design is the high-level strategy for solving the problem and building a solution. During analysis, the focus is on what needs to be done, independent of how it is done.

During design, decisions are made about how the problem will be solved, first at high level, then at increasingly detailed levels.

It is the first design stage in which the basic approach to solving the problem is selected. During system design, the overall structure and style are decided. The purpose of design phase is to plan a solution of the problem. Starting with what is needed design takes us toward how to satisfy the needs. It is a most critical factor which affects the quality of the system. The design activity results in 3 separate outputs:o Architecture designo High level designo Detailed design o Architecture focus on identifying components and how they connect.o High level design focuses on identifying the modules.o Detailed design focuses on designing the logic for each of the modules.

The following decisions should be made during system design are: Estimate system performance Make a reuse plan Organize the system into subsystems Identify concurrency inherent in the problem Allocate subsystems to hardware Manage data stores Handle global resources Choose a software control strategy Handle boundary conditions Set trade-off priorities Select an architectural style Early in the planning for a new system one should prepare a rough performance

estimate. Engineers call this a “back of the envelope” calculation. Example ATM

OOAD

System Design 2

Making a Reuse PlanThere are two very aspects of reuse.• Using existing things • Creating reusable new things

Reusable things includes Models Libraries Framework Patterns

Librariesa library is a collection of classes that r useful in many contexts .the classes must have accurate and thorough description to help users to determine there relevance.

Qualities of a “good” class libraries…. Coherence: a class library should be organized about if you, well focus themes Completeness: a class library should provide a complete behavior for the chosen themes Consistency: polymorphic operation should have consistent names and signature across

classes Efficiency: a library should provide alternative implementations of algorithms that trade

time and space. Extensibility: the user should b able to define sub classes for library classes . Generosity: a library should use parameterized class definition where appropriate.

Areas where problem may occur Problems can arise when integrating class libraries from multiple sources. Class libraries may adopt policies that are individually sensible , but fundamentally

incompatible with those of the other class libraries. Problems:

Argument validation Error handling Control paradigms Group operation Garbage collection Name collision

OOAD

System Design 3

Breaking a System Into Subsystems First step in system design is to divide the system into a small number of components. Each subsystem encompasses aspects of the system that share some common property:

similar functionality, the same physical location or execution on the same kind of hardware.

A subsystem is not an object nor a function but a package of classes, associations, operations, events and constraints that are interrelated and that have a reasonably well-defined and small interface with other subsystems.

OOAD

System Design 4

A subsystem is usually identified by the service it provides. A service is a group of related functions that share some common purpose, such as I/O

processing, drawing pictures. Each subsystem has a well defined interface to the rest of the system. The interface

specifies the form of all interactions and the information flow across subsystem boundaries but does not specify how the subsystem is implemented internally.

Subsystems should be defined in such a manner that it has more cohesion and less coupling.

The relationship between two subsystems can be client-supplier or peer-to-peer. The decomposition of systems into subsystems may be organized as a sequence of

horizontal layers or vertical partitions.

Management of data storage There are several kinds of data storage such as data structures, files and databases. Different kinds of data stores provide trade-offs among cost, access time, capacity and reliability. For example, a personal computer application may use memory, data structures and files. An accounting system may use a database to connect subsystems. Files are cheap, simple, and permanent. However, file operations are low level, and applications must include additional code to provide a suitable level of abstraction. File implementations vary for different computer systems, so portable applications must carefully isolate file-system dependencies. Implementations for sequential files are mostly standard, but commands and storage formats for random access files are mostly standard but commands and storage formats for random access files and indexed files vary.Data suitable for files

Data with high volume and low information density. Modest quantities of data with simple structure. Data that are accessed sequentially. Data that can be fully read into memory. Databases, managed by database management systems(DBMSs), are another kind of

data store. Various types of DBMSs are available from vendors, including relational and OO.

Data Suitable for databases: Data that requires updates at fine levels of details by multiple users. Data that must be accessed by multiple application programs. Data that require coordinated updates via transactions.

OOAD

System Design 5

Large quantities of data that must be handled efficiently. Data that are long-lived and highly valuable to an organization. Data that must be secured against unauthorized access.

Handling global resources Handling global resources means the system designer must identify global resources and determine mechanisms for controlling access to them. There are several kinds of global resources:

Physical units : Examples include processors, tape drives, and communication satellites. Space : Examples include disk space, a workstation screen, and the buttons on a mouse. Logical names : Examples include object IDs, filenames, and class names. Access to shared data : Database. If the resource is a physical object, then it can control itself by establishing a protocol for

obtaining access. If the resource is a logical entity, such as an object ID or a database, then there is a danger of conflicting access in a shared environment. Independent tasks could simultaneously use the same object ID, for example we can avoid conflict by having a “guardian object” own each global resource and control to access to it. One guardian object can control several resources.

All access to the resource must pass through the guardian object. Allocating each shared global resource to a single object is a recognition that the resource has identity. The cost of passing all access to a resource through a guardian object is sometimes too high, and clients must access the resource directly. In this case, locks can be placed on subsets of the resource. A lock is a logical object associated with some defined subset subset of a resource that gives a lock holder the right to access resource directly.

Example: ATM

Choose the Software control strategy• Two kinds of control system in Software system:

– External control– Internal control

• External control concerns the flow on externally visible events among objects.• Three kinds of control external event:

– Procedure-driven sequential– Event-driven sequential– Concurrent

• Control style depend on the available resource (language, OS) and on the kind of interaction.

OOAD

System Design 6

• Internal control refers to the flow of control within the process.• It is only used in implementation therefore neither concurrent or sequential.Procedure-driven Control• Control resided inside the program code.Basic working:• Procedure request for input event and wait for it.• When event arrives, control resumes within the procedure that made the call.Advantage:• Easy to implement with conventional programming.• Procedure-driven paradigm is suitable only if state model shows a regular alternation of

input and output events.Note:• C++ and Java are procedural languages. That is why they fail to support concurrency

inherent in objects.Event-driven Control• Control resides within a dispatcher or monitor that the language, subsystem or OS

provides.Basic Working• Dispatcher call the procedure when events occurs.• Procedure call to the dispatcher sent output or enable input but do not wait for it in-

line.• Once event is over, procedure return control to the dispatcher instead on retaining.Advantage:• More flexible control than procedure-driven systems.• Event-driven system are more modular and can handle error conditions better than

procedure-driven system.Concurrent Control• Control resides concurrently in several independent objects, each a separate task.Basic Working:• A task can wait for input but other tasks continue execution.• OS resolves scheduling conflicts among tasks and usually supplies a queuing mechanism

so that events are not lost.Internal control• Internal object interaction are similar to external object interaction because you can use

the same implementation mechanisms.• Importance difference is

– External interaction inherently involve events, because objects are independent.

OOAD

System Design 7

– Internal interaction involve operation as procedure calls.• Other paradigm are possible such as

– Rule based systems– Logic programming system– Other forms Nonprocedural programs

• Developer used such languages in limited areas only such as– Artificial Intelligence– Knowledge based programming –

COMMON ARCHITECTURAL STYLES• Several kinds of system listed :

– Batch transformation – Continuous transformation – Interactive interface – Dynamic simulation – Real-time system – Transaction Manager

BATCH TRANSFORMATION• A batch transformation performs sequential computations.Working:• Application receives the input• Compute the answer• No ongoing interaction with outside worldExample:• Computational problems such as compilers, payroll processing etc.• For batch transformation problem, we can use class and interaction models. • As it contains input, output and intervening stages.• Most important thing is it should define a clean series of steps.

• Compiler has five class model

OOAD

Parse TextDetermine

connectivityAbstract to OO

modelGenerate DB code

ASCII code

Graphics model

Connectivity model

class model

Database model

System Design 8

– One for input, one for output and three for intermediate representation.Steps for designing batch transformation:

• Break overall transformation into stages– Each stage performing one part of transformation.

• Prepare class models for input, output and intermediate stages. • Expand each stage until the operation are- easy to implement.• Restructure the final pipeline for optimizations.

CONTINUOUS TRANSFORMATINONWhat is continuous transformation?? A continuous transformation is a system in which the output activity depends on the

changing inputs Unlike batch transformation system that computes the outputs only once, A continuous transformation updates output frequently.:- because of severe time constraints the system cannot recomputed the entire set of outputs each time an input changes

INTERACTIVE INTERFACE

• It is a system that is dominated by interactions between the system and external agents, such as humans or devices.

• The external agents are independent of the system, so the system cannot control the agents, - although it may solicit responses from them.

• II includes usually a part of an entire APPLICATION, one that can be handled independently from computations.

• Examples include FORM BASED QUERY INTRFACE, a wrokstation windowing system, control panel for simulation.

OOAD

System Design 9

Form-based Interfaces

This interface consist of forms which are adapted to the user. He/She can fill in all of the fields and make new entries to the database or only some of the fields to query the other ones. But some operations might be restricted by the application. Form-based user interfaces are wide spread and are a very important means of interacting with a DBMS. They are easy to use and have the advantage that the user does not need special knowledge about database languages like SQL.

MAJOR CONCERNS : Communications protocol b/w the system and external agents. The syntax of possible interactions. The presentation of output. The flow of control within the system. Performance. Error handling.

CLASS MODELS represent II : Input tokens. Output tokens. presentation formats.

(TOKEN : a thing serving as a visible or tangible representation of a fact, quality, feeling, etc) Isolate interface classes from the application classes. Use predefined classes to interact with external agents. EXAMPLE : windowing systems (GUI ) have extensive collection of predefined >windows

>menus >buttons >forms

Isolate physical events from logical events….often logical event corresponds to multiple physical events. Example: a graphical interface can take input from a

OOAD

System Design 10

> form > a pop-up menu > function button on keyboard > typed-in cmd seq. > an indirect cmd file.

and other kinds of classes ready to be adapted to applications. Use state model as the structure of the program. (A state model represents the process

model for one type of change request.) II are best implemented using concurrent control / event-driven control. Fully specify the application functions that are invoked by the interface. Make sure that the information to implement them is present.

DYNAMIC SIMULATIONDynamic simulation models or tracks objects in the real world.Traditional methodologies built on data flow diagrams are poor at representing these problems because simulation involves many distinct objects that constantly update themselves , rather than a single large transformation.

• Two ways of implementing control of dynamic simulation • explicit control• internal • Steps in designing a dynamic simulation• Identify actors , active real world objects , from the object model.• Identify discrete events.• Identify continuous dependencies.• Generally a simulation is driven by a timing loop at a fine time scale.• Problems • The hardest problem with simulation is usually providing adequate performance .

REAL-TIME SYSTEMWhat is real-time system?A real time system is an interactive system With tight time constraints on actions.It is one of the type of Common ArchitecturalStylesThere are 2 types of real-time systema)Hard-real time Systemb)Soft-real time Systema)Hard-real time System:- It involves critical applications that require

OOAD

System Design 11

a guaranteed response within the timeconstraints. b)Soft-real time System:- It must also be highly reliable,but canoccasionally violate time constraints

• Typical real-time applications includeProcess control,data acquisition,communi-ations devices,device control and overloadrelays.

• Real-time design is complex and involves issues such as interrupt handling,prioritization of tasks and co-ordinating multiple CPUs.Unfortunately, real-time systems are frequently designed to operate close to their resource limits,so that severe,nonlogical reconstructing of the design is often needed to achieve the necessary performance

TRANSACTION MANAGER• A transaction manager is a system whose main function is to store and retrieve data• Most transaction managers deal with multiple users who read and write data at the

same time.• They also must secure their data to protect it from unauthorized access as well as

accidental loss• Transaction managers are often built on top of a DBMS-this is a form of reuse. • A DBMS has generic functionality for managing data that you can reuse and need not

implement.• It is also one of the type of Common Architectural Styles

The steps in designing an informationsystem are as follows-

Map the class model to database structures Determine the units of concurrency Determine the unit of transaction Design concurrency control for transactions

OOAD

System Design 12

OOAD