documenting and designing architectures using together tom gullion

49
Documenting and Designing Architectures Using Together Tom Gullion <[email protected]>

Upload: aubrey-holt

Post on 14-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Documenting and Designing Architectures Using Together Tom Gullion

Documenting and Designing Architectures Using Together

Tom Gullion<[email protected]>

Page 2: Documenting and Designing Architectures Using Together Tom Gullion

Communication

Architecture is all about communication.

Today’s software systems are amazingly complex, requiring models as a way to illustrate the design to a wide variety of people.

Architecture is well-known as a development best practice.

Page 3: Documenting and Designing Architectures Using Together Tom Gullion

Good vs. Bad Architecture

The major problem: what makes an architecture good or bad?

In general, the four goals of good design…• High cohesion• Low coupling• Evenly distributed behavior• Strong modularity

Charles Richter in Designing Flexible Object-Oriented Systems with UML, 1999, Macmillan Technical Publishing

Perhaps what really separates good and bad architectures is more a question of the how well they are crafted…

Page 4: Documenting and Designing Architectures Using Together Tom Gullion

Well-crafted Architectures

This session will focus on a set of techniques to maximize

• Communication• Consistency• Understandability• Providing Context• Documentation

Instead of bickering in terms of how extensible or scalable, let’s discuss how to craft a project to best describe an architecture

Page 5: Documenting and Designing Architectures Using Together Tom Gullion

UML as…

Martin Fowler suggests UML is commonly used in three ways:

• UMLAsSketch• UMLAsBlueprint• UMLAsProgrammingLanguage

see www.martinfowler.com/bliki/

Page 6: Documenting and Designing Architectures Using Together Tom Gullion

UMLAsSketch

Typically on a whiteboard, in a drawing tool, on the back of a napkin…

Just enough design to get started writing code

Probably used on every software project

Disposable

Lost learning opportunity perhaps

Page 7: Documenting and Designing Architectures Using Together Tom Gullion

UMLAsBlueprint

Model is a first-class element in the project

Together’s sweet spot: the model is the code, the code is the model

Requires LiveSourceTM (simultaneous round-trip engineering)

PSM (Platform Specific Model) in MDA (Model Driven Architecture)

Key enabler to Model-Driven Development

Page 8: Documenting and Designing Architectures Using Together Tom Gullion

UMLAsProgrammingLanguage

Extensions to UML which provide the ability to model a system with sufficient specificity so as to be able to compile and deploy the application directly from the model

Requires a UML profile, action semantics, model compiler

Typically uses subset of UML: class and state diagrams plus action semantics

Some people’s view of MDA nirvana

Page 9: Documenting and Designing Architectures Using Together Tom Gullion

Focus on UMLAsBlueprint

UMLAsBlueprint approach provides the most value throughout the lifecycle:

• Captures initial design• Improves communication• Stays in sync with evolution of project• Always up-to-date documentation• Useful in maintenance phases too• Consider Alistair Cockburn:

Software development is a game whose two primary goals are to “deliver the software and to create an advantageous position for the next game, which is either altering or replacing the system or creating a neighboring system” Agile Software Development, Addison-Wesley, 2001.

Page 10: Documenting and Designing Architectures Using Together Tom Gullion

Architecture = Blueprints

Page 11: Documenting and Designing Architectures Using Together Tom Gullion

Consistency

Architectural blueprints are efficient because they use a common notational system

UML provides a standard notation for software

Blueprints are also effective because they are consistent

Page 12: Documenting and Designing Architectures Using Together Tom Gullion

Coding Standards

Every project defines its coding standards

• spaces vs tabs• location of the curly braces• naming conventions• etc.

Note: Together includes Audits which automate inspection of source code to ensure projects adhere to coding standards…

Page 13: Documenting and Designing Architectures Using Together Tom Gullion

Modeling Standards

Why don’t more projects define similar standards for their UML models?

Consider Scott Ambler’s UML Style Guide as a place to start: http://www.agilemodeling.com/style/

Note: Together will soon include Model Audits which automate inspection of models to ensure projects adhere to modeling standards…

Page 14: Documenting and Designing Architectures Using Together Tom Gullion

Key Modeling Standards

• Legend (UML Note) to set context• Inheritance – horizontal or vertical• Activity Diagrams – flow horizontal or

vertical• Naming conventions• Use Case template

where does the use case text go anyway?

• Many more…

Page 15: Documenting and Designing Architectures Using Together Tom Gullion

UML Note as Legend

Page 16: Documenting and Designing Architectures Using Together Tom Gullion

Inheritance Layout

Page 17: Documenting and Designing Architectures Using Together Tom Gullion

Activity Diagram – Vertical Layout

Page 18: Documenting and Designing Architectures Using Together Tom Gullion

Activity Diagram - Horizontal Layout

Page 19: Documenting and Designing Architectures Using Together Tom Gullion

Naming Conventions• Same a Coding Standards

– Classes• Singular, self-documenting

– Interfaces• “I” prefix or “able” suffix• Do you use ILog or Loggable?

• Package naming conventions– Lowercase, no spaces

• Other modeling elements?– Use Cases, Activities, States, etc.

Page 20: Documenting and Designing Architectures Using Together Tom Gullion

Architecture = Blueprints

Page 21: Documenting and Designing Architectures Using Together Tom Gullion

Multiple Perspectives

Sample blueprint only provided one perspective

What about the carpenters? electricians? plumbers? the guy who purchases all the materials?

Each one of these roles may require a completely different view of the project

Page 22: Documenting and Designing Architectures Using Together Tom Gullion

Multiple Perspectives

Software architectures require multiple perspectives as well

Projects roles such as sponsors, architects, developers, testers, etc. all benefit from separation of concerns

Page 23: Documenting and Designing Architectures Using Together Tom Gullion

Providing Context

An Overview diagram is an easy way to guide various model viewers through the collection of diagrams

Consists of UML Notes with commentary and a collection of shortcuts into the key sections of the model

Page 24: Documenting and Designing Architectures Using Together Tom Gullion

Overview Diagram

shortcuts

Page 25: Documenting and Designing Architectures Using Together Tom Gullion

Separating Concerns

Model partitioning

separate projects vs packages in one project

Providing views, multiple perspectives

Reduce complexity

don't have to absorb it all at once

Page 26: Documenting and Designing Architectures Using Together Tom Gullion

Configuring Diagram Detail

Diagrams can be configured to several levels of detail

Analysis: no types, no visibility

Design: add types and visibility

Implementation: show everything

Page 27: Documenting and Designing Architectures Using Together Tom Gullion

Analysis Package

Configure diagram to elide low-level details

High-level detail which models the collaborations

Analysis Object Model

Page 28: Documenting and Designing Architectures Using Together Tom Gullion

Sample diagram: Analysis

Page 29: Documenting and Designing Architectures Using Together Tom Gullion

Sample diagram: Design

Page 30: Documenting and Designing Architectures Using Together Tom Gullion

Sample diagram: Implementation

Page 31: Documenting and Designing Architectures Using Together Tom Gullion

Hyperlinks Provide Traceability

In Together, hyperlinks are a simple, yet effective, way to provide traceability within the model

Page 32: Documenting and Designing Architectures Using Together Tom Gullion

UML TracesUML notation for traceability is an arrow with a

dashed line and stereotyped as <<trace>>This is often implemented as a line drawn on a

diagram

This is a flawed concept because:– traceability is a one-to-many relationship– traceability should show relation of high-level to more

refined view – which means elements will not appear on the same diagram

– doesn’t scale graphically – trace links cause visual clutter

<<trace>>

Page 33: Documenting and Designing Architectures Using Together Tom Gullion

Model Traceability

link analysis element to refinement

Design

Analysis

Hyperlinks as traces

Page 34: Documenting and Designing Architectures Using Together Tom Gullion

Hyperlink Example

Page 35: Documenting and Designing Architectures Using Together Tom Gullion

Intramodel Traceability

For example:

Page 36: Documenting and Designing Architectures Using Together Tom Gullion

Architecture and LiveSourceTM

Balancing preserving the design and the benefits of LiveSource

Two diametrically opposed goals:

preserve the original design and

living view of the app

Guttenburg Dilemma (lose the thinking steps along the way)

Page 37: Documenting and Designing Architectures Using Together Tom Gullion

Package vs Class Diagrams

<four square> vs <three square>

Fundamental concept you need to know

Highly effective communication device

Page 38: Documenting and Designing Architectures Using Together Tom Gullion

Package Diagrams

Default view of a directory

Shows all source files

Classes and interfaces added externally automatically appear

Page 39: Documenting and Designing Architectures Using Together Tom Gullion

Package Diagram Example

Page 40: Documenting and Designing Architectures Using Together Tom Gullion

Class Diagrams

Logical view

Shows only elements added as shortcuts

Useful for overviews, illustrating key architectural structures, temporary work diagrams and, of course, documentation

Page 41: Documenting and Designing Architectures Using Together Tom Gullion

Class Diagram Example

Page 42: Documenting and Designing Architectures Using Together Tom Gullion

Class Diagram Usage Scenarios

Commonly used for:• Overview diagrams• Logical views• Illustrate key concepts within the model• Automate dependency checking• Temporary work product

Page 43: Documenting and Designing Architectures Using Together Tom Gullion

Versioning Package and Class Diagrams

Another project standard to consider

Whether to version package diagrams?

If they’re a default view of a directory, what’s the point in putting them under version control?

Page 44: Documenting and Designing Architectures Using Together Tom Gullion

Dependency Checking

Right-click dependency

and choose

“Show Dependencies”

Page 45: Documenting and Designing Architectures Using Together Tom Gullion

Documenting Component Usage

Page 46: Documenting and Designing Architectures Using Together Tom Gullion

Documenting Pattern Usage

Page 47: Documenting and Designing Architectures Using Together Tom Gullion

Modeling a User Interface

Page 48: Documenting and Designing Architectures Using Together Tom Gullion

SWT Example

Page 49: Documenting and Designing Architectures Using Together Tom Gullion

Questions and Answers

Tom Gullion

Borland Software Corporation

<[email protected]>