Layers

14
© Lethbridge/Laganière 2001 1/14 Layers Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified for pedagogical reasons.

description

Layers. Data from IBM-Rational and Craig Larman’s text integrated into these slides. These are great references… Slides from these sources have been modified for pedagogical reasons. Objectives of Architectural Design. - PowerPoint PPT Presentation

Transcript of Layers

Page 1: Layers

© Lethbridge/Laganière 2001 1/14

Layers

Data from IBM-Rational and Craig Larman’s text integrated into these slides.

These are great references…

Slides from these sources have been modified for pedagogical reasons.

Page 2: Layers

© Lethbridge/Laganière 2001 2/14

Objectives of Architectural Design

• In Architectural Design, we define the pieces/parts (generalizing: “components”) of the system and their relationships.

• Relationships implies dependencies, services needed, and more.•in our case, these pieces will be organized into

well-defined layers •Layers will

— provide services, and — exhibit explicit dependencies— subscribe to accepted principles of

‘layering.’

Page 3: Layers

© Lethbridge/Laganière 2001 3/14

Objectives of Architectural Design

• Architectural Design - starting point for design.

• Remember, design bridges a major gap: •Problem Space

(requirements, use cases, analysis modeling, prototyping…to the

•Solution Space.

• Equivalently, we are mapping ‘what’ to ‘how.’

•We will talk in terms of design (solution) elements

Page 4: Layers

© Lethbridge/Laganière 2001 4/14

Architect

Designer

ArchitecturalAnalysis

ArchitectureReviewer

Review theDesign

Review theArchitecture

Use-CaseAnalysis

ArchitecturalDesign

DescribeConcurrency

DescribeDistribution

ClassDesign

Subsystem Design

Use-Case Design

DesignReviewer

Architectural Design in Context – ‘about choices!’

Our workflow – a tailored version of the Analysis and Design core workflow of the RUP.

In Use Case Analysis: looked at requirements; allocated responsibilities to analysis classes.

Now undertake Architectural Design.

Page 5: Layers

© Lethbridge/Laganière 2001 5/14

More…We have defined and decided upon a

• a layered architecture, and we should

• recorded decisions as to the contents of each layer.

In continuing our Architectural Design we will refine our analysis classes (boundary, control, entity) into design elements (design classes, subsystems, components)

Architectural layers constitute the implementation environment.

We will allocate these design elements to layers;

within layers, to packages and subsystems in the architecture.

Page 6: Layers

© Lethbridge/Laganière 2001 6/14

1. Typical Layering Approach

General functionality

Specific functionality

This is a very broad generalization. in practice, things will be considerably different and application dependent in many cases.Note: this is also a very general view; may/may not include a GUI layer.

Page 7: Layers

© Lethbridge/Laganière 2001 7/14

LAYERS – in general, there are several scenarios…Certain packages in a layer may/may not use services

of layers directly beneath them.

Layers don’t necessarily shield one layer from other. • a package in application layer may need some domain services – in a

domain layer beneath them. Thus, for those packages, there is a domain services layer beneath them.

• A package in the same upper layer may need technical services. For these packages, dependencies are on layers beneath them but skipping an intervening layer and go directly to middleware component.

• Application layer has components unique to the application.• Business specific (domain layer) may have reusable subsystems • Middleware layer may likely have the DB Controller, transaction dispatcher, Broker (pattern), persistency

mechanisms, security mechanisms and other classes and associated relationships.

Page 8: Layers

© Lethbridge/Laganière 2001 8/14

2. Multi-Tier Layered Architecture - Example

Separate presentation and application logic, and other areas of concern.

Consider:

Different names (in some cases). Can see the main idea!

Discuss! UI Layer (or Presentation Layer)

“Domain” or “Application Logic” Layer

Services Layer

PersistenceSubsystem

LoggingSubsystem

SecuritySubsystem

(Interface may/may not be graphical…)

(May/may not need both…)

Page 9: Layers

© Lethbridge/Laganière 2001 9/14

UI

Summaries Editors

Domain

CoreEvaluation

Policies

Services

Persistence Logging Reporting Security

In more detail: A Simple Logical Architecture

Using UML, logical partitioning illustrated with package /subsystem diagrams. The layers ‘might’ look like these….a design choice!

Here, the User Interface is first.

Some authors call this a Presentation Layer (makes sense if UI is graphical…)

These might be the only layers needed.

Page 10: Layers

© Lethbridge/Laganière 2001 10/14

Adding An Application Coordination Layer – another twist?

Consider an “application coordination layer” whose objects represent use cases. This is often (not always) a better design.

UI

Summaries Editors

AppCoordination

Domain

CoreEvaluation

Policies

RentingVideoUCHandler

PayingFinesUCHandler

Added this layer!(look like controlclass names…)

Page 11: Layers

© Lethbridge/Laganière 2001 11/14

Continuing: Showing Package Dependencies (good slide w/dependencies)

It is useful to show the coupling with UML dependency lines.

Further, it is helpful to cite the purpose of each subsystem / package to show how these design elements cohere.

Document these.

UI

MajorFunctions

Editors

AppCoordination

Domain

CoreEvaluation

Policies

Services

Persistence Logging

Discuss the dependencies!!

Page 12: Layers

© Lethbridge/Laganière 2001 12/14

Ordering WorkWhat do we now

start?

What do/can we now do in parallel?

• How?

UI

MajorFunctions

Editors

AppCoordination

Domain

CoreEvaluation

Policies

Services

Persistence Logging

Discuss!

Page 13: Layers

© Lethbridge/Laganière 2001 13/14

A Little Variation with this Thinking

Next slide is VERY good!

This architectural approach adds layers but ratchets down a bit.

Note the cohesion in each layer (what it does; area of concern)

Note also the dependencies.

Page 14: Layers

© Lethbridge/Laganière 2001 14/14

3. Here is still another view of layers: Note the suggested layer contents

Presentation(AKA Interface, UI, View)

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

Domain(s)(AKA Business,

Business Services, Model)

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

Foundation(AKA Core Services, Base Services,

Low-level Technical Services/Infrastructure)

width implies range of applicability

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

(Relatively) high-level technical servicesand frameworksPersistence, Security

Low-level technical services, utilities,and frameworks Data structures, threads, math,

file, DB, and network I/O

dep

en

den

cy

Business Infrastructure(AKA Low-level Business Services)

Very general low-level business services Used in many business domains

more application specific