Docsity

Computer Science Design: Understanding Architectural Styles and Decomposition Techniques, Study notes of Software Engineering

Partial preview of the text

Download Computer Science Design: Understanding Architectural Styles and Decomposition Techniques and more Study notes Software Engineering in PDF only on Docsity!

cmsc435 - 1

Design

Objectives

l To introduce design and to discuss its importance

l To describe the general design process

l To explain architectural design decisions that have to be made

l To introduce three complementary architectural styles covering organization, decomposition and control

l To discuss reference architectures are used to communicate and compare architectures

cmsc435 - 3

Conceptual design

l Tells the customer what the system will do l Answers:  Where will the data come from?  What will happen to the data in the system?  What will the system look like to users?  What choices will be offered to users?  What is the timing of events?  What will the reports and screens look like? l Characteristics of good conceptual design  in customer language with no technical jargon  describes system functions  independent of implementation  linked to requirements

Technical design

l Tells the programmers what the system will do l Includes:  major hardware components and their function  hierarchy and function of software components  data structures  data flow l Methods:  Modular decomposition  Data-oriented decomposition  Event-oriented decomposition  Outside-in design  Object-oriented design

cmsc435 - 7

Object-oriented specifications

l Each entity in the system is an object. l A method or operation is an action that can be performed directly by the object or can happen to the object. l Encapsulation: the methods form a protective boundary around an object. l Class hierarchies of objects encourage inheritance. l Polymorphism: same method for different objects, each with different behavior l Will not discuss in great detail. You should already be experts in OO techniques.

OO design

l Usually uses an OO requirements representation

l System design identifies and represents objects and classes, plus details of each objects attributes and behaviors.

l System design also identifies interactions and relationships. l Program design inserts computational features in the models.

l Program design inserts class library details. l Program design considers nonfunctional requirements to enhance design.

cmsc435 - 9

Important design issues

l Modularity and levels of abstraction

l Collaborative design

l Designing the user interface  metaphors, mental model, navigation rules, look and feel  cultural issues  user preferences

l Concurrency

l Design patterns and reuse

External event handling:^ Functional dimensions^ Structural dimensions

  • • No external eventsProcess events while waiting for input
  • External events preempt user commands

Application interface abstraction level • Monolithic program

  • • Abstract deviceToolkit
  • • Interaction manager with fixed data typesInteraction manager with extensible data types User customizability^ •^ Extensible interaction manager
  • • HighMedium
  • Low

Abstract device variability • Ideal device

  • • Parameterized deviceDevice with variable operations User interface adaptability across devices^ •^ Ad hoc device
  • • NoneLocal behavior changes
  • • Global behavior changeApplication semantics change

Notation for user interface definition • Implicit in shared user interface code

  • • Implicit in application codeExternal declarative notation
  • • External procedural notationInternal declarative notation Computer system organization^ •^ Internal procedural notation
  • • UniprocessingMultiprocessing
  • Distributed processing

Basis of communication • Events

  • • Pure stateState with hints Basic interface class^ •^ State plus events
  • • Menu selectionForm filling
  • • Command languageNatural language
  • Direct manipulation

Control thread mechanisms • None

  • • Standard processesLightweight processes
  • • Non-preemptive processesEvent handlers Application portability across user interface styles^ •^ Interrupt service routines
  • • HighMedium
  • Low

Issues to consider in trade-off analysis

(Lane, in Shaw and Garlan 1996)

cmsc435 - 13

Design evaluation and validation

l Mathematical validation l Measuring design quality l Comparing designs  one specification, many designs  comparison table l Design reviews

Attribute Priority Shared data

Abstract data type

Implicit invocation

Pipe and filter

Easy to change algorithm

1 1 2 4 5

Easy to change data representation

4 1 5 2 1

Easy to change function

3 4 1 4 5

Good performance

3 5 4 2 2

Easy to reuse 5 1 4 2 5

Weighted comparison of Shaw and Garlan designs

cmsc435 - 15

Design reviews

l Preliminary design review  examines conceptual design with customer and users l Critical design review  presents technical design to developers l Program design review  programmers get feedback on their designs before implementation l We’ll discuss inspections, a more formalized review, shortly

Questions for any design review

Is it a solution to the problem? Is it modular, well-structured, and easy to understand? Can we improve the structure and understandability? Is it portable to other platforms? Is it reusable? Is it easy to modify or expand? Does it support ease of testing? Does it maximize performance, where appropriate? Does it reuse components from other projects, where appropriate? Are the algorithms appropriate, or can they be improved? If this system is to have a phased development, are the phases interfaced sufficiently so that there is an easy transition from one phase to the next? Is it well-documented, including design choices and rationale? Does it cross-reference the components and data with the requirements? Does it use appropriate techniques for handling faults and preventing failures?

cmsc435 - 19

Advantages of explicit architecture

l Stakeholder communication  Architecture may be used as a focus of discussion by system stakeholders.

l System analysis  Means that analysis of whether the system can meet its non-functional requirements is possible.

l Large-scale reuse  The architecture may be reusable across a range of systems.

Architectural conflicts

l Basic conflicts are between performance and (safety, reliability, or maintainability)

l Using large-grain components improves performance but reduces maintainability.

l Introducing redundant data improves availability but makes security more difficult.

l Localizing safety-related features usually means more communication so degraded performance.

cmsc435 - 21

System structuring

l Concerned with decomposing the system into interacting sub-systems.

l The architectural design is normally expressed as a block diagram presenting an overview of the system structure.

l More specific models showing how sub- systems share data, are distributed and interface with each other may also be developed.

Packing robot control system

system^ Vision

identification^ Object system controller^ Arm controller^ Gripper

Packagingselection system

Packingsystem Conveyor controller

Functional block decomposition

cmsc435 - 25

Architecture reuse

l Systems in the same domain often have similar architectures that reflect domain concepts.

l Application product lines are built around a core architecture with variants that satisfy particular customer requirements.

l The architectural model of a system may conform to a generic architectural model or style.

l Application architectures are covered in Chapter 13 and product lines in Chapter 18.

Sample architectural models

l Used to document an architectural design.

l Static structural model that shows the major system components. l Dynamic process model that shows the process structure of the system. l Interface model that defines sub-system interfaces.

l Relationships model such as a data-flow model that shows sub-system relationships. l Distribution model that shows how sub- systems are distributed across computers.

cmsc435 - 27

System organization

l Reflects the basic strategy that is used to structure a system.

l Three organizational styles are widely used:

  1. A shared data repository style;
  2. A client - server style;
  3. An abstract machine or layered style.

1. The repository model

l Sub-systems must exchange data. This may be done in two ways:  Shared data is held in a central database or repository and may be accessed by all sub-systems;  Each sub-system maintains its own database and passes data explicitly to other sub-systems.

l When large amounts of data are to be shared, the repository model of sharing is most commonly used.

cmsc435 - 31

2. Client-server model

l Distributed system model which shows how data and processing is distributed across a range of components.

l Set of stand-alone servers which provide specific services such as printing, data management, etc.

l Set of clients which call on these services.

l Network which allows clients to access servers.

Film and picture library

cmsc435 - 33

Client-server characteristics

l Advantages  Distribution of data is straightforward;  Makes effective use of networked systems. May allow for cheaper hardware;  Can more easily process data in parallel;  Strict protocol between client and server. Can more easily add new clients or new servers or upgrade existing servers. l Disadvantages  No shared data model so sub-systems use different data organization. Data interchange may be inefficient;  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.

3. Abstract machine (layered) model

l Also called the virtual machine model (e.g., it is how the Java Virtual Machine [JVM] is built into web browsers) l Used to model the interfacing of sub-systems. l Organizes the system into a set of layers (or abstract machines) each of which provide a set of services. l Supports the incremental development of sub-systems in different layers. When a layer interface changes, only the adjacent layer is affected. l However, often artificial to structure systems in this way.

cmsc435 - 37

Modular decomposition

l Two modular decomposition models covered  An object model where the system is decomposed into interacting object;  A pipeline or data-flow model where the system is decomposed into functional modules which transform inputs to outputs.

l If possible, decisions about concurrency should be delayed until modules are implemented.

Object models

l Structure the system into a set of loosely coupled objects with well-defined interfaces.

l Object-oriented decomposition is concerned with identifying object classes, their attributes and operations.

l When implemented, objects are created from these classes and some control model used to coordinate object operations.

l You should be fairly good at building object models by now.

cmsc435 - 39

Invoice processing system

Object model advantages

l Objects are loosely coupled so their implementation can be modified without affecting other objects.

l The objects may reflect real-world entities.

l OO implementation languages are widely used.

l However, object interface changes may cause problems and complex entities may be hard to represent as objects.