Analysis and Design of Client-Server Systems
Analysis and Design of Client-Server Systems
Analysis and Design of Client-Server Systems
University of Maryland Baltimore County Module 6 for Bell Atlantic Michael Grasso [email protected]
UMBC, Slide 1
Objectives
Module Objective To acquaint the participant with software analysis and design, with an emphasis on applications in client/server environments. Textbook Software Engineering by Ian Sommerville, 5th Edition. Essential Client Server Survival Guide by Orfali In-Class Exercises As individuals or teams, create data flow and/or control flow models for a sample application, using the standard notations. As individuals or teams, given a design document for a small system, modify that diagram to suit a small set of new requirements. Module Completion Requirement The participant will be required to demonstrate familiarity with principles of systems analysis and design, including the ability to read and understand diagrams developed using one of the techniques listed.
Analysis and Design of Client/Server Systems UMBC, Slide 2
Page 1
Outline
Section 1: Introduction to Software Analysis and Design Introduction and basic principles Software methodologies Requirements specification CASE tools for analysis and design Client/Server Systems Architectural design Section 2: Analysis and Design Techniques Functional Approaches Data-Driven Approaches Behavioral Approaches Reading List Software Engineering Client Server Survival Guide
Analysis and Design of Client/Server Systems
Slide 4
Slide 49
Introduction and basic principles Software methodologies Requirements specification CASE tools for analysis and design Client/Server systems Architectural design
UMBC, Slide 4
Page 2
A Software Crisis
A 1979 GAO report (FGMSD-80-4, 11/79) evaluated 7 million dollars worth of software development projects and discovered that as a percentage of cost: 47% were never used 29% were never delivered 19% required extensive reworking or were abandoned 3% required additional modifications 2% met its requirements Tom DeMarco pointed out in 1982 that 25 percent of large system development projects never finish. (Controlling Software Projects, Prentice Hall, 1982) Capers Jones documented in 1991 the gloomy statistic that the average MIS development project is one year late and 100 percent over budget. (American Programmer, 6/91)
Analysis and Design of Client/Server Systems UMBC, Slide 5
What is Analysis
Analysis is the process of extracting the needs of a system - what the system should do, not how the system will be implemented. It is the problem-oriented (not the solution-oriented) phase in the software engineering process. Although we have a natural affinity toward results-oriented tasks (e.g., design), we need to focus more on the problem to avoid treating merely the symptoms and to provide an unbiased view of the situation. (George Wedberg, But First, Understand the Problem, ASM Journal of Systems Management, page 22-28, 6/90) The risk of mortality ... increases when treatment is begun before a specific diagnosis has been reached. (The Merck Manual, 13th Edition, page 765, 1977)
UMBC, Slide 6
Page 3
UMBC, Slide 7
Analysis Challenges
Problem Domain Understanding To design an accounting system, an analyst needs to become an expert in accounting systems, and will probably need to understand these systems better than the average user will. Person-To-Person Communication It is very difficult for people from different perspectives to share ideas with each other. For example, an analyst and a user, or a manager and a worker. Continual Change Requirements will change. Your designs need to account for change and should attempt to minimize their effect. Reuse Reuse of code as well as design and analysis results.
Analysis and Design of Client/Server Systems UMBC, Slide 8
Page 4
UMBC, Slide 9
UMBC, Slide 10
Page 5
Functional Decomposition
The mapping of the problem domain to a set of functions and subfunctions. The original and probably the still the most commonly used approach. Analyst is required to map the problem domain (e.g., air traffic control) to functions and sub-functions. This is an indirect conversion that is highly volatile and sometimes arbitrary.
UMBC, Slide 12
Page 6
Functional Decomposition
Structured Analysis
The mapping of the problem domain to flows and transformations. This is an indirect conversion that has a strong function emphasis and is therefore highly volatile. This approach is not very useful in systems that primarily update and retrieve data. There are no useful bubbles (transformations). Traditionally, data and function are separated in this approach using data flow and entity relationship diagrams. This keeps critical issues too disjoint. Also, analysis results must be converted into another format for design.
UMBC, Slide 14
Page 7
Structured Analysis
UMBC, Slide 15
Data Modeling
The mapping of the problems domain into the following. Entities Attributes Relationships Inheritance Aggregation This is a partial solution which is missing specific concepts. Functions/Operations Messages
Data Modeling
UMBC, Slide 16
Page 8
UMBC, Slide 18
Page 9
Software Prototyping
Rapid prototyping is an important requirements validation technique. Start with an outline specification. Develop prototype. Users experiment with prototype to refine and improve the specification. This is especially important to identify user interface requirements. It often difficult - if not impossible - to model these requirements with abstract techniques.
UMBC, Slide 19
Page 10
Prototyping Techniques
Executable specification languages. Formal specification languages can be difficult to work with. Very high-level languages. LISP, Prolog, or Smalltalk. Fourth-generation languages. Visual Basic, Powerbuilder. Composition of reusable components Develop a library of application framework classes that can be easily integrated.
UMBC, Slide 21
Requirements Specification
The software requirements specification (SRS) is a complete description of the external behavior of the software system. It is often used as part of the system contract. It is the basis for designing a system. SRS notation. Natural language. Good for novices, but inherently ambiguous. Structured language. Use controlled natural language to minimize ambiguities. Program design language (PDL). A language based on programming constructs. May be too biased toward design. Non-functional requirements (along with functional requirements). Constraints based on cost, interoperability, performance, access, safety, privacy, etc.
Analysis and Design of Client/Server Systems UMBC, Slide 22
Page 11
Page 12
Requirements Validation
Once developed, requirements must be validated to show they meet the needs of the system procurer. This includes the following steps. The needs of the user should be shown to be valid. Further thought may reveal requirements which are not needed. Extremely difficult to do without prototyping. The requirements should be shown to be consistent, complete, etc. Based on attributes of good requirements. The requirements should be realistic. No point specifying requirements which are unrealizable.
UMBC, Slide 25
Requirements Reviews
Validation should not be done only after the SRS has been completed. It should be carried out by a series of reviews throughout the development process. These can be informal or formal. Informal reviews simply involve contractors discussing requirements with clients. In a formal review, the development team should walk the client through the system requirements. Explaining the implications of each requirement. Pointing out conflicts and contradictions. Identifying actions items to resolve problems. This is typically a manual process, involving multiple readers from both the contractor and client staff.
UMBC, Slide 26
Page 13
CASE Tools
Computer-aided software engineering (CASE) has come into use as a generic term for the automated support of software engineering. Tools are available for the following process activities (analysis, design, implementation, verification & validation).
Classification Planning and estimation Text editing Document preparation Configuration management Prototyping Diagram editing Data dictionary User interface management Method support Language processing Program analysis Interactive debugging Test data generation
Analysis and Design of Client/Server Systems
A x x x x x x x x
D x x x x x x x x x x
I x x x x
V x x x x x
x x x x
x x
UMBC, Slide 27
UMBC, Slide 28
Page 14
Client/Server Computing
Client/Server computing attriubutes. A decentralized architecture. Transparent access to information. GUI front-end coupled to a server-based RDBMS. There are four design components for client/server applications. Presentation logic End-user interaction. Business logic Carry out transactions using data from the user and the database. Database logic Manipulates data within the application (possibly with SQL). Database processing Actual processing of the database data.
UMBC, Slide 29
Database Logic Placed on the client If database logic is embedded in the business logic. If clients maintain some low-interaction, quasi-static data. Database Processing Placed on the server Assuming all clients share a common database. Move Logic to Server Include shared fragments of business and database logic. Move parts of business and database logic to server for cases where server has most knowledge of the impact of this logic.
Analysis and Design of Client/Server Systems UMBC, Slide 30
Page 15
Architectural Design
Architectural design is usually concerned with decomposing a system into a set of interacting sub-systems which model the following. How subsystems share data. How they interface with each other. System decomposition models include the following. Repository models. Client/server models. Abstract machine models. Control models include the following. Centralized control. Event driven systems. Modular decomposition includes the following. Object-oriented model. Data-flow model.
Analysis and Design of Client/Server Systems UMBC, Slide 32
Page 16
Repository Model
All shared data is held in a central database that can be accessed by all subsystems. Alternatively, each subsystem maintains its own database. Advantages. Efficient way to share data (no need to explicit transmit data between subsystems). Centralized control of backup, security, access control, and recovery. Can easily integrate new tools into the repository. Disadvantages. All subsystems must use the same repository model, which may compromise their optimal data layout. Different subsystems may have different administration policies. Replication of a distribute repository may introduce problems with data redundancy and inconsistency.
Analysis and Design of Client/Server Systems UMBC, Slide 33
Design editor
Code generator
Project Repository
Design analyzer
Analysis and Design of Client/Server Systems
Report generator
UMBC, Slide 34
Page 17
Client/Server Model
The client/server architectural model is based on the following. A set of stand-alone servers which offer services to other subsystems. A set of clients subsystems that call on the services offered by the servers. A network which allows the clients access to these services. The repository model can be implemented as a client/server model, where the repository is the lone server. Advantages. Decoupling client with server allows transparent access and a modular design which is easy modify and extend. Disadvantages. No shared data model. No centralized control and administration.
Analysis and Design of Client/Server Systems UMBC, Slide 35
Client 1
Client 2
Client 3
Network
Database Server
Hypertext Server
Video Server
UMBC, Slide 36
Page 18
UMBC, Slide 38
Page 19
Centralized Control
One subsystem has overall responsibility for control. It may give control to another subsystem, but expects to have that control responsibility returned to it. There are two forms of this approach. The call-return model. Top-down, hierarchical control through subroutines. Relatively simple to analyze and implement. Exceptions to normal hierarchical control are awkward to handle. The centralized management model. Often used in quasi-real-time systems with soft time constraints. The central controller manages the execution of a set of processes. Typically implemented with a polling loop.
UMBC, Slide 39
routine 2
routine 3
computation processes
Analysis and Design of Client/Server Systems
fault handler
UMBC, Slide 40
Page 20
Event-Driven Systems
Event driven control models are driven by externally generated events. In centralize control models, control decisions are usually determined by the values of some system state variables. There are two event-driven control models. Broadcast models. Interrupt-driven models.
UMBC, Slide 41
Broadcast Models
Broadcast models are used to integrate subsystems distributed across different computers on a network. Events are broadcast to all subsystems. The subsystem designed to handle the event responds to it. In the centralized model, the control policy is embedded in the handler. The subsystem may also be able to explicitly send a message to a specific subsystem. Advantages. System modification and evolution is relatively simple. Distributed subsystems are easy to support. Disadvantages. Subsystems don't know if or when events will be handled. Multiple subsystems may handle the same event, causing conflicts.
Analysis and Design of Client/Server Systems UMBC, Slide 42
Page 21
Subsystem 1
Subsystem 2
Subsystem 3
UMBC, Slide 43
Interrupt-Driven Models
Interrupt-driven models are used exclusively in real-time systems. External interrupts are detected and handled by an interrupt handler and passed to some component for processing. There are a know number of interrupt types, each associated with the memory location where its handler's address. A hardware switch causes control to be transferred immediately to its handler. Advantages. It allows very fast responses to events. Disadvantages. It is complex to program and difficult to validate. Difficult to simulate patterns of interrupt timing during system testing. Hard to debug program errors.
Analysis and Design of Client/Server Systems UMBC, Slide 44
Page 22
handler 1
handler 2
handler 3
UMBC, Slide 45
Modular Decomposition
Once the architectural design has been specified, each subsystem must be decomposed into modules. This can follow two approaches. Object-oriented model. A set of loosely coupled objects with well-defined interfaces. Loose coupling with information hiding makes modifications easier and enhances reuse. May not work well if these software objects do not have welldefined interfaces. Data-flow model. Data flows through functional transformations in sequence. Supports reuse of transformations Uses an intuitive format that has been widely adopted. May not work well with interactive systems or other applications, which are difficult to represent as flows of data through transformations.
Analysis and Design of Client/Server Systems UMBC, Slide 46
Page 23
UMBC, Slide 47
UMBC, Slide 48
Page 24
UMBC, Slide 49
UMBC, Slide 50
Page 25
UMBC, Slide 51
Page 26
Transformation
Data Flow
Terminator
Data Store
UMBC, Slide 53
Printer
UMBC, Slide 54
Page 27
UMBC, Slide 55
UMBC, Slide 56
Page 28
UMBC, Slide 57
SADT
Structured Analysis and Design Technique (SADT) was developed in the 1970s by Doug Ross at SofTech, Inc. The SADT model is composed of a hierarchy of diagrams. The uppermost diagram is the context diagram. Lower-level diagrams refine the system into sub-problems. SADT is requirements analysis technique. The decomposition during analysis is to help you understand the problem. This may differ from implementation decisions during design to determine the appropriate combination of performance, efficiency, reliability, maintainability, modifiability, etc. Disadvantages of SADT. Diagrams imply a linear progression between functions. Position requirements of arrows can be awkward.
Analysis and Design of Client/Server Systems UMBC, Slide 58
Page 29
SADT Notation
Boxes. Each diagram is composed of boxes and arrows. Boxes are usually arranged along a diagonal with unique numbers. In activity models, boxes represent functions with unique names based on verb phrases and arrows as noun phrases. In data models, boxes represent data with unique names based on noun phrases and arrows are verb phrases. Four Types of Arrows. Arrows pointing to the left side of the box represent things that will be transformed by the box. Arrows pointing down to the box represent control information that affects the transformation. Arrows entering the bottom of the box represent supporting mechanisms, such as physical resources for the transformation. Arrows leaving from the right of the box represent outputs from the transformation.
Analysis and Design of Client/Server Systems UMBC, Slide 59
request
printNextJob
result
UMBC, Slide 60
Page 30
result printJob
2
job
file name
removeJob
3
UMBC, Slide 61
Structure Charts
The structure chart is typically used as a design tool. Shows the hierarchical organization of modules within one task. Must transform DFD (asynchronous, network) into a synchronous hierarchy. Module A calls module B one or more times. Module A is suspended until module B finishes (synchronous).
B
UMBC, Slide 62
Page 31
status
removeJob
UMBC, Slide 63
Entity-Relationship Diagram
The entity-relationship (E-R) model is based on an abstraction of a real world which consists of a set of basic objects - entities and relationships. The ERD uses a network model to describe the stored data of a system at a high level of abstration. Implementation or physical considerations are deferred. It is quite different from DFD or SADT, which model the functions performed by a system. It is typically the primary model for data-driven design, especially when using relational databases.
UMBC, Slide 64
Page 32
ERD Notation
Entity Drawn as a rectangle. An entity is an object that exists and is distinguishable. Similar to a record in a programming language with attributes. Relationship Drawn as a diamond. An association among several entities. Relationships may have attributes. Relationships have cardinality (e.g., one-to-many) Arrow means one, no arrow means many. Attribute Drawn as ellipses. Similar to record fields in a programming language. Each attribute has a set of permitted values, called the domain. Primary key attributes may be underlined.
Analysis and Design of Client/Server Systems UMBC, Slide 65
ERD Example
date amount tran# acct# balance interest-rate savings account
transaction
log
account
ISA
custAcct
branchAcct bname
bcity assets
customer loan#
Analysis and Design of Client/Server Systems
borrow amount
branch
UMBC, Slide 66
Page 33
UMBC, Slide 67
Data Dictionary
A data dictionary (DD) is a repository in which to store information about all data items defined in the system. The data dictionary may be derived from data in any of the following. Requirements. Data Flow Diagrams. Entity-Relationship Diagrams. The typical information in a data dictionary. Name of the data item. Description or purpose. Data structure definition. Related data items. Range of values or other referential integrity information. Diagrams where the item is referenced.
UMBC, Slide 68
Page 34
UMBC, Slide 69
STD Notation
States. Represented as a rectangle. A valid system state. Events. Drawn as a labeled arrow. A signal that something has happened which forces a transition to another state. Inputs and Outputs (optional). Drawn as input/output on the event arrow. The input that triggers the transition and the output with which the system responds.
UMBC, Slide 70
Page 35
STD Example
STD for print queue.
UMBC, Slide 71
UMBC, Slide 72
Page 36
surveillance data
UMBC, Slide 73
Page 37
UMBC, Slide 75
borrower ckOutDate
borrow ckInDate
media
UMBC, Slide 76
Page 38
UMBC, Slide 77
Page 39
UMBC, Slide 80
Page 40
UMBC, Slide 81
UMBC, Slide 82
Page 41
UMBC, Slide 83
UMBC, Slide 84
Page 42
employees
UMBC, Slide 85
employees
UMBC, Slide 86
Page 43
cname
cid cost date color sale cost amount in stock widget types
customer
ename
eid
size
UMBC, Slide 87
red light request, current data request, summary data request vessels current data, summary data, SOS data Buoy
SOS request
sailor
UMBC, Slide 88
Page 44
sensor control
UMBC, Slide 90
Page 45