Architectures (2)

Embed Size (px)

Citation preview

  • 8/7/2019 Architectures (2)

    1/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 1

    XVIII. Software ArchitecturesXVIII. Software Architectures

    Software Architectures

    UML Packages

    Client-Server vs Peer-to-Peer

    3-Tier and 4-Tier Architectures

    Horizontal Layers and Vertical Partitions

    The Model-View-Controller Architecture

    Broker Architectures for Distributed Systems

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 2

    Software ArchitecturesSoftware Architectures

    A software architecture defines the components of a software systemand how they use each others functionality and data.

    For example, theclient-serverclient-serverarchitecture consists ofserversservers, whichsupport some kind of service, and clientsclients which request and useserver services. With a client-server architecture, an informationsystem need not be seen as a monolithic program.

    Instead, input/output functions are placed on clients, running on PCsand workstations; data storage is assigned to a server, implementedin terms of a DBMS (e.g., DB2, Ingres, Sybase or Oracle) and placedon a mainframe or mini. Consistency checking is located with theserver, applications are located with clients.

    Thick serversThick serversoffer a lot of functionality,thinthinones little.

    Thick clientsThick clients have their own services, thinthin ones get almosteverything from servers.

    In these lecture notes, we emphasizeobject-oriented architectures.

  • 8/7/2019 Architectures (2)

    2/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 3

    SubsystemsSubsystems

    A subsystem is a component of a system or of anothersubsystem.

    ModulesModules are atomic subsystems (which are not furtherdecomposed into subsystems.)

    Its useful to subdivide a software system into subsystems For better-managed software development; For improved reuse potential (through components); For improved portability (platform-specific code isolated to

    particular subsystems.) For easier maintenance.

    Each subsystem has a well-defined interface with respect to the

    rest of the system.

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 4

    System

    Subsystem Subsystem Subsystem

    Subsystem

    Subsystem

    Subsystem

    Subsystem

    Subsystem

    ...

    Subsystem

    Subsystem

    Subsystem

    Subsystem

    Module

    Module

    Module

    Module

    Module

    Module

    ... ... ...

    componentOf

  • 8/7/2019 Architectures (2)

    3/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 5

    Components and ConnectorsComponents and Connectors

    The architecture shown in the previous slide is one exampleof a software architecture where the nodes representsubsystems or modules and the connectors between themdescribe componentOf relationships.

    There are many others kinds of connectors that can be used,such as:

    Uses -- one component uses data defined in anothercomponent;

    Calls-- one component calls methods defined in anothercomponent;

    I/O -- the output of one component is fed as input to

    another;

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 6

    The SoftwareThe Software

    BookshelfBookshelf

  • 8/7/2019 Architectures (2)

    4/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 7

    Architectural Styles

    It is useful to classify software architectures into classes ofarchitectural styles.

    For example, the client-server architecture discussed earlier isan architectural style.

    The styles well discuss below are as follows:

    Pipes and filters;

    Object-Orientation;

    Event-Based

    Layered;

    Repository-Based;

    Client-Server; Three-Tier;

    more...

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 8

    PackagesPackages

    A package in UML is a grouping of elements; these elements

    May be packages (representing subsystems or modules);

    May be classes;

    Each element of a software architecture (subsystem, moduleor class) is owned by a single package;

    Packages may reference other packages.

    There are many criteria to use in decomposing a software systeminto packages:

    Ownership -- who is responsible from which diagrams;

    Application -- each application has its own obvious partitions;e.g., a university dept model may be partitioned into staff,courses, degree programmes,

    Clusters of classes used together, e.g., course, coursedescription, instructor, student,

  • 8/7/2019 Architectures (2)

    5/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 9

    A Package DiagramA Package Diagram

    A dependency means thatif you change a class in onepackage (Meetings), you

    maymay have to changesomething in the other(Constraints).

    The concept is similar tocompilation dependencies.

    Its desirable to minimizedependency cycles, if at allpossible.

    Persons

    Meetings

    Constraints

    dependency

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 10

    Decomposition into SubsystemsDecomposition into Subsystems

    A software system may be decomposed into horizontal layershorizontal layers,and/orvertical partitionsvertical partitions.

    For a horizontal layer decomposition, each layer corresponds toone or more subsystems, and each layer uses services providedby the layers below it.

    Layered architectures have two forms:

    closed architecture- each layer only uses services of thelayer immediatebelow;

    open architecture- a layer can use services from any lower

    layer.

  • 8/7/2019 Architectures (2)

    6/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 11

    ClosedClosedvsvsOpenOpen

    Layered ArchitectureLayered Architecture

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 12

    Closed layered architectures

    Minimize dependencies between layers and reduce the impactof a change to the interface of any one layer.

    Open layered architectures

    Lead to more compact code, since the services of all lowerlayers can be accessed directly without the need for extraprogram code to pass messages through each interveninglayer;

    Break the encapsulation of layers, increase dependenciesbetween layers and increase the complexity of changes to thesystem.

    ClosedClosedvsvsOpenOpenLayered ArchitecturesLayered Architectures

  • 8/7/2019 Architectures (2)

    7/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 13

    Client Server Architectures

    A client server architecture consists of service consumers(clients) andservice providers (servers). Clients and serversmay or may not be running on dedicated machines.

    Information exchange between clients and servers is donethrough messages.

    Service requests and responses are accomplished through oneof the following protocols:

    Remote Procedure Call (RPC) -- client invokes a remotelylocated procedure, which is executed and the results sent tothe client; RPC is widely supported;

    Remote Data Access (RDA)-- here the invoked procedure isa database query (say, in SQL) and the response is an oftenlarge set of data; supported by DBMS vendors;

    Queued Message Processing -- here requests are queuedand processed whenever possible.

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 14

    Three-Tier Client Server Architectures

    Used widely in industry

    E.g., architecture for a meeting scheduling system (MSS)

    User Processing Dataclient server serverclient

    request request

    response response

    MSS Client MSS Server

    DatabaseServer

    SchedulingLogic

    Facility MgtLogic

    User MgtLogic

    InitializationLogic

    DB InterfaceLogic

    Conflict ResLogic

    PaymentLogic

    PanelInitialization

    Main MenuPanel

    SchedulingPanels

    FacilityMgt Panels

    ConfigurationPanels

    User MgtPanels

    User Processing(Business Logic)

    Data

  • 8/7/2019 Architectures (2)

    8/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 15

    Many Possible Variations

    User Processing Data

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 16

    Web-Based Software Architectures

    These are client server too, but they are based on WWWtechnologies.

    Such architectures are becoming very popular because of staticHTML-based applications, but also dynamic ones, such as thosethat involve Ecommerce.

    HTTP --HyperText Transfer Protocol, used to transfer hypertextdocuments over the internet;

    HTML --HyperText Markup Language, used to define hypertextdocuments;

    CGI -- Common Gateway Interface is a program (e.g., a unixshell script, or a perl script)

    CGI scripts are programs that reside on a web server and areexecuted with a click to retrieve data, generate graphics etc.

  • 8/7/2019 Architectures (2)

    9/19

  • 8/7/2019 Architectures (2)

    10/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 19

    Dynamic HTML-Based Architecture

    The CGI gateway serves as demon which dispatches a request, dealtwith by an application or a database server.

    HTTP

    Server

    HTMLDocuments

    Stream

    Manager

    Path

    Resolver

    CGI

    Applications

    Files +

    Databases

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 20

    Document Interchange ExampleDocument Interchange Example

    ANALYST, the General Motors Dealer Review Advisor.ANALYST, the General Motors Dealer Review Advisor.

    Assists credit analysts in 230 GM Acceptance Corporationbranch offices analyzing dealership operations in order todecide on credit applications.

    Offers many benefits, including faster reviews, reduced trainingof personnel and consistency in decision-making.

    Uses an expert system, integrated into vast, conventional dataprocessing architecture

  • 8/7/2019 Architectures (2)

    11/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 21

    ANALYST Local ArchitectureANALYST Local Architecture

    REMOTE HOST

    INTERFACE

    DEALERSHIP DATA

    MANAGEMENT

    EXPERT SYSTEM

    REVIEW ADVISOR

    DEALERSHIP

    DATABASE

    CLERICAL

    DATA

    ENTRY

    CLERK

    CREDIT

    ANALYST

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 22

    ANALYST Global ArchitectureANALYST Global Architecture

    GMAC

    WHOLESALE

    SYSTEM

    GMAC

    RETAIL

    SYSTEM

    DEALER

    TIME SALES

    SYSTEM

    GMAC

    400 CARD

    SYSTEM

    ANALYST

    SUPPORT

    SYSTEM

    GM DEALERSHIP

    FINANCIAL

    SYSTEM

    SNA

    NETWORK

    BRANCH BRANCH BRANCH

    nightly feeds

    onlinequeries,updates

    onlinequeries,updates

    onlinequeries,updates

    onlinequeries,updates

    nightlyuploads,

    downloads

  • 8/7/2019 Architectures (2)

    12/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 23

    Four-Layer ArchitecturesFour-Layer Architectures

    for Information Systemsfor Information Systems

    This is a variation of the 3-tier architectureThis is a variation of the 3-tier architecture

    we discussed earlierwe discussed earlier

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 24

    Vertical PartitioningVertical Partitioning Now the idea is to partition each layer into subsystems.

    Partitioning identifies weakly coupled subsystems within alayer.

    Each partition provides a self-contained service for the rest ofthe system.

  • 8/7/2019 Architectures (2)

    13/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 25

    Architecture for the A-7E AircraftFunction Drivers

    Shared Services

    S/W

    UtilitiesData

    Banker Physical

    ModelsFilter

    Behaviours

    Device Interfaces

    Application Data Types

    Extended Computer

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 26

    Notes on the A-7E Architecture

    This is a uses architecture, I.e., shows which component usesresources in another component.Modules in the different components of the architecture:

    Extended computer: virtual memory module, parallelismmodule, timer module;

    Device interfaces: air data module, audible signal devicemodule, Doppler radar set module,;

    Function driving module: flight information display module,,panel module, ground test module,;

    Application data types: numeric, state transition data types;

    Data banker module: singular values module, complex eventmodule,;

    Physical model: aircraft motion module, earth characteristicsmodule, human factors module;

    Software utilities: powerup module.

  • 8/7/2019 Architectures (2)

    14/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 27

    Styles of Communication:Styles of Communication:

    Client-Server vs Peer-to-PeerClient-Server vs Peer-to-Peer

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 28

    The Model View Controller (MVC)The Model View Controller (MVC)ArchitectureArchitecture

    First used with Smalltalk but has since become widely used asan architecture for object-oriented software systems.

    Capable of supporting user requirements that are presentedthrough differing interface styles

    Aids maintainability and portability

    This architecture is best suited for software systems where userinterfaces play an important role.

  • 8/7/2019 Architectures (2)

    15/19

  • 8/7/2019 Architectures (2)

    16/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 31

    Responsibilities of MVCResponsibilities of MVC

    ComponentsComponents

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 32

    MVC Component InteractionMVC Component Interaction

  • 8/7/2019 Architectures (2)

    17/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 33

    Broker ArchitecturesBroker Architectures

    for Distributed Systemsfor Distributed Systems A broker increases the flexibility of the system by decoupling the

    client and server components

    Each client sends its requests to the broker rather thancommunicating directly with the server component

    The broker then forwards the service request to anappropriate server

    The client need not know where the server is locate (it may be inlocal or remote computer)

    Only the broker needs to know the location of the servers that ithandles

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 34

    Simplified Broker ArchitectureSimplified Broker Architecture

  • 8/7/2019 Architectures (2)

    18/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 35

    BrokerBroker

    ArchitectureArchitecture

    for Localfor Local

    ServerServer

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 36

    Threading and ConcurrencyThreading and Concurrency Each independent flow of control can be modelled as an active

    object that represents a process or thread that can initiate controlactivity.

    A process is a heavyweight flow (known to the operatingsystems itself) that can execute concurrently with otherprocesses

    A thread is a lightweight flow that can execute concurrentlywith other threads within the same process.

    Dynamic model of the design identifies concurrent parts of thesystem:

    Sequence diagrams imply sequential threads of execution -sequences of messages that invoke each other procedurally;

    State and activity diagrams can model concurrent executionwhere different event sequences can lead to concurrentexecution.

  • 8/7/2019 Architectures (2)

    19/19

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 37

    SummarySummary

    Architectural system (I.e., hardware and software) designaddresses issues of hardware and software location,interconnectivity, distribution of I/O processes, data storesand application processes.

    Architectural system design is the most important step ofsystem design and can, literally, make or break aninformation system development project.

    2003 Jaelson Castro and John Mylopoulos

    CSC340Information Systems Analysis and Design

    OO Architectures -- 38

    Additional ReadingsAdditional Readings

    [Booch99] Booch, G. Rumbaugh, J., Jacobson, I., The UnifiedModeling Language User Guide. Chapter 22. Addison-Wesley.

    [Rumbaugh91] Rumbaugh, J et al. Object-Oriented Modelingand Design. Chapter 9, Prentice-Hall.