SOEN 343 Software Design

  • View
    46

  • Download
    5

Embed Size (px)

DESCRIPTION

SOEN 343 Software Design. Section H Fall 2006 Dr Greg Butler http://www.cs.concordia.ca/~gregb/home/soen343h-f06.html. Outline. Importance of domain model, use cases, operation contracts for design Layers MVC Use case realization, Jacobson robustness analysis, traceability - PowerPoint PPT Presentation

Text of SOEN 343 Software Design

  • SOEN 343Software DesignSection H Fall 2006Dr Greg Butlerhttp://www.cs.concordia.ca/~gregb/home/soen343h-f06.html

  • OutlineImportance of domain model, use cases, operation contracts for designLayersMVCUse case realization, Jacobson robustness analysis, traceabilityGRASP Controller principle (Larman 17.13)Design for visibility (Larman ch 19)

  • Design Model

    Class

    Cashier

    Class

    Records

    1..*

    (1)msg()

    output

    x: Class

    *

    1..40

    *

    1..40

    Records

    (1)msg()

    Cashier

    Buying Items

    DD file

    DD file

    Cashier

    Buying Items

    *

    ClassName

    attributes

    operations

    1

    Require-ments

    Business Modeling

    Design

    Design Model

    : Register

    enterItem(itemID, quantity)

    : ProductCatalog

    spec = getProductSpec( itemID )

    Register

    ...

    Sample UP Artifact Relationships

    Vision

    SupplementarySpecification

    Glossary

    The logical architecture is influenced by the constraints and non-functional requirements captured in the Supp. Spec.

    makeNewSale()enterItem(...)...

    Domain Model

    Use-Case Model

    ProductCatalog

    ...

    getProductSpec(...)...

    class diagrams(a static view)

    interaction diagrams(a dynamic view)

    UI

    package diagramsof the logical architecture(a static view)

    Domain

    Tech Services

  • Logical Architecture Simple Layers

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Text

    Class

    newClass

    Class

    Note

    Records

    Technical Services

    Persistence

    Logging

    Swing

    Web

    RulesEngine

    Domain

    Sales

    Payments

    UI

    not the Java Swing libraries, but our GUI classes based on Swing

    Taxes

  • Logical Architecture Layers

    ClassName

    attributes

    operations

    xxx

    id:Class

    1: msg()

    1: msg()

    Cashier

    Note

    Note

    Note

    Class

    Text

    Records

    GUI windowsreportsspeech interfaceHTML, XML, XSLT, JSP, Javascript, ...

    handles presentation layer requestsworkflowsession statewindow/page transitionsconsolidation/transformation of disparate data for presentation

    handles application layer requestsimplementation of domain rulesdomain services (POS, Inventory)- services may be used by just one application, but there is also the possibility of multi-application services

    Technical Services(AKA Technical Infrastructure, High-level Technical Services)

    Foundation(AKA Core Services, Base Services,Low-level Technical Services/Infrastructure)

    (relatively) high-level technical services and frameworks Persistence, Security

    low-level technical services, utilities, and frameworksdata structures, threads, math, file, DB, and network I/O

    moreapp specific

    width implies range of applicability

    Business Infrastructure(AKA Low-level Business Services)

    dependency

    very general low-level business services used in many business domainsCurrencyConverter

    UI(AKA Presentation, View)

    Application(AKA Workflow, Process,Mediation, App Controller)

    Domain(AKA Business, Application Logic, Model)

  • Logical Architecture Layers & Partitions

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Text

    Class

    Technical Services

    POS

    Inventory

    Logging

    Tax

    Vertical Layers

    Horizontal Partitions

    Persistence

    Domain

    Security

  • Logical Architecture Layers & Partitions

    ClassName

    attributes

    operations

    xxx

    id:Class

    1: msg()

    1: msg()

    Cashier

    Note

    Note

    Note

    Class

    Text

    Records

    Class

    MySQL Inventory

    UML notation: A UML component, or replaceable, modular part of the physical system

    Technical Services

    Foundation

    Persistence

    componentNovellLDAP

    Naming andDirectory Services

    Web AppFramework

    Technical Services

    POS

    Inventory

    Domain(s)

    Domain(s)

    UML notation: A physical database in the UML.

    Foundation

    Worsemixes logical and deployment views

    Bettera logical view

    a logical representation of the need for data or services related to these subdomains, abstracting implementation decisions such as a database.

  • Domain Model and Domain LayerLow representational gap

    Store

    role

    records

    *

    Class

    records

    1..40

    ClassName

    attributes

    operations

    role

    Drag the side handles to change the width of the text block.

    *

    Class

    ClassName

    attributes

    operations

    1

    1

    Note

    Payment

    amount: Money

    Payment

    amount

    getBalance(): Money

    Sale

    date: DatestartTime: Time

    Sale

    getTotal(): Money. . .

    datetime

    Pays-for

    Pays-for

    UP Domain ModelStakeholder's view of the noteworthy concepts in the domain.

    Domain layer of the architecture in the UP Design ModelThe object-oriented developer has taken inspiration from the real world domain in creating software classes.

    Therefore, the representational gap between how stakeholders conceive the domain, and its representation in software, has been lowered.

    A Payment in the Domain Model is a concept, but a Payment in the Design Model is a software class. They are not the same thing, but the former inspired the naming and definition of the latter.

    This reduces the representational gap.

    This is one of the big ideas in object technology.

    inspires objects and names in

  • SSDs, System Operations & Layers

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Text

    Class

    newClass

    Class

    Note

    Records

    Class

    Cashier

    1: msg()

    1: msg()

    Cashier

    ...

    makeNewSale()enterItem()endSale()

    makeNewSale()enterItem()endSale()

    Register

    makeNewSale()enterItem()...

    enterItem(id, quantity)

    :System

    ...

    Swing

    ProcessSaleFrame

    Domain

    : Cashier

    : Cashier

    endSale()

    makeNewSale()

    description, total

    the system operations handled by the system in an SSD represent the operation calls on the Application or Domain layer from the UI layer

    UI

  • Model-View Separation Principle (MVC)

    UI layer has viewsDomain layer has model

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Package

    Text

    Class

    newClass

    Class

    Note

    Records

    Technical Services

    Persistence

    Logging

    Swing

    Web

    RulesEngine

    Domain

    Sales

    Payments

    UI

    not the Java Swing libraries, but our GUI classes based on Swing

    Taxes

  • Model-View-Control Architecture (MVC)MVC is an acronym for Model View ControllerIt represents a software design pattern developed at Xerox PARC in 1978 (!)It explains a method of separating the visual, interaction and data components.Very popular, used extensively in Java and other languages

  • Model-View-Control Architecture (MVC)Modelmaintains the state and data of the application - the XML documentViewA rendering of the XML documentControllerThe user interface presented to the user to manipulate the application

  • Why use MVCMakes it very easy to have multiple different displays of the same information.For example: a graph and a table could both display and edit the same data.Essentially provides greater control over the UI and its behaviour.

  • MVC ModelThe Model contains the data Has methods to access and possibly update its contents.Often, it implements an interface which defines the allowed model interactions.Implementing an interface enables models to be pulled out and replaced without programming changes.

  • MVC ControllerUsers interact with the controller.It interprets mouse movement, clicks, keystrokes, etcCommunicates those activities to the model eg: delete row, insert row, etcIts interaction with the model indirectly causes the View(s) to update

  • MVC ViewThe View provides a visual representation of the model.There can be multiple views displaying the model at any one time.For example, a companies finances over time could be represented as a table and a graph.These are just two different views of the same data.When the model is updated, all Views are informed and given a chance to update themselves.

  • 14.4 Design ObjectsSpend plenty of time on dynamic models(see notation chapter 15)

  • Jacobsons Objectory Design Objects

  • Jacobsons Objectory Design ObjectsRobustness model hasEntity objectsBoundary (interface objects)Control objects

    Essentially UML collaboration (communication) diagram

  • Jacobsons Robustness Analysis Bridges Analysis-Design Gap

  • What are the users doing? (Jacobson)What are the objects in the real world? (Rumbaugh)What objects are needed for each use case? (Jacobson)How do the objects collaborate with each other? (Jacobson and Booch)How will we implement real-time control? (state models)How are we really going to build this system? (Booch)

  • Traceability

  • PA