Documenting and Designing Architectures Using Together Tom Gullion.
-
Upload
aubrey-holt -
Category
Documents
-
view
222 -
download
0
Transcript of Documenting and Designing Architectures Using Together Tom Gullion.
![Page 2: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/2.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/3.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/4.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/5.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/6.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/7.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/8.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/9.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/10.jpg)
Architecture = Blueprints
![Page 11: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/11.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/12.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/13.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/14.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/15.jpg)
UML Note as Legend
![Page 16: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/16.jpg)
Inheritance Layout
![Page 17: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/17.jpg)
Activity Diagram – Vertical Layout
![Page 18: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/18.jpg)
Activity Diagram - Horizontal Layout
![Page 19: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/19.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/20.jpg)
Architecture = Blueprints
![Page 21: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/21.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/22.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/23.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/24.jpg)
Overview Diagram
shortcuts
![Page 25: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/25.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/26.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/27.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/28.jpg)
Sample diagram: Analysis
![Page 29: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/29.jpg)
Sample diagram: Design
![Page 30: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/30.jpg)
Sample diagram: Implementation
![Page 31: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/31.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/32.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/33.jpg)
Model Traceability
link analysis element to refinement
Design
Analysis
Hyperlinks as traces
![Page 34: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/34.jpg)
Hyperlink Example
![Page 35: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/35.jpg)
Intramodel Traceability
For example:
![Page 36: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/36.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/37.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/38.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/39.jpg)
Package Diagram Example
![Page 40: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/40.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/41.jpg)
Class Diagram Example
![Page 42: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/42.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/43.jpg)
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.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/44.jpg)
Dependency Checking
Right-click dependency
and choose
“Show Dependencies”
![Page 45: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/45.jpg)
Documenting Component Usage
![Page 46: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/46.jpg)
Documenting Pattern Usage
![Page 47: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/47.jpg)
Modeling a User Interface
![Page 48: Documenting and Designing Architectures Using Together Tom Gullion.](https://reader038.fdocuments.us/reader038/viewer/2022110206/56649f425503460f94c61b80/html5/thumbnails/48.jpg)
SWT Example