Design Implementation

Download Report

Transcript Design Implementation

University of Southern California
Center for Systems and Software Engineering
Design Implementation
Pongtip Aroonvatanaporn
[Based on material by David Woollard]
CSCI 577b Spring 2012
January 23, 2012
University of Southern California
Center for Systems and Software Engineering
What you already know
• Architecture patterns are helpful to
developers
• Styles are good source of inspiration
– But not a silver bullet
– No one size fits all
– Rules can be broken, but with rationale
• Requirements drive design and vice versa
• How to achieve faithful implementation?
1/23/12
(C) USC-CSSE
2
University of Southern California
Center for Systems and Software Engineering
Outline
•
•
•
•
•
•
Faithful Implementation
Implementation Strategies
Mapping the Architecture
Middleware and Frameworks
Conclusion
A Technologist’s Perspective
1/23/12
(C) USC-CSSE
3
University of Southern California
Center for Systems and Software Engineering
Faithful Implementation
• The definition
• Structural elements  Source code
– All should be there
• Source code must not utilize new major
computational elements not specified in
architecture
• Source code must not contain new
connections not found in architecture
• Can we deviate from this?
1/23/12
(C) USC-CSSE
4
University of Southern California
Center for Systems and Software Engineering
Unfaithful Implementation
• The implementation has its own
architecture
– Implementation is the architecture
• Impacts of failure to recognize distinction
between designed and implemented
architecture
– Ability to reason about application’s
architecture in future
– Misleading (what they think vs. what they have)
– Evolution strategies based on documented
architecture doomed to failure
1/23/12
(C) USC-CSSE
5
University of Southern California
Center for Systems and Software Engineering
Outline
•
•
•
•
•
•
Faithful Implementation
Implementation Strategies
Mapping the Architecture
Middleware and Frameworks
Conclusion
A Technologist’s Perspective
1/23/12
(C) USC-CSSE
6
University of Southern California
Center for Systems and Software Engineering
Implementation Strategies
• Generative techniques
– Parser generators
• Frameworks
– “Fill in the blanks”
• Middleware
– CORBA, RPC, etc.
• Reuse-based techniques
– COTS, NDI, NCS, open-source, in-house
• Writing all code from scratch
1/23/12
(C) USC-CSSE
7
University of Southern California
Center for Systems and Software Engineering
Outline
•
•
•
•
•
•
Faithful Implementation
Implementation Strategies
Mapping the Architecture
Middleware and Frameworks
Conclusion
A Technologist’s Perspective
1/23/12
(C) USC-CSSE
8
University of Southern California
Center for Systems and Software Engineering
The Mapping Problem
• Architecture-based development is
basically a mapping problem
• Maintaining mapping means ensuring that
architectural intent reflects the
implemented system
Design
Decisions
1/23/12
Implementation
Artifacts
(C) USC-CSSE
9
University of Southern California
Center for Systems and Software Engineering
What to Map?
• Components and Connectors
–
–
–
–
–
Computation functionalities
Communication functionalities
Modules, packages, libraries, classes
Software/hardware components
Middleware
• Interfaces
– Programming language level interfaces
– APIs, function, or method signatures
1/23/12
(C) USC-CSSE
10
University of Southern California
Center for Systems and Software Engineering
What to Map?
• Configurations
– Interconnections and dependencies between
components
– May be implicit in implementation
– May be externally enabled through middleware
– May involve the use of reflection
• Design rationale
– Retained as comments and notes
– An important aspect
1/23/12
(C) USC-CSSE
11
University of Southern California
Center for Systems and Software Engineering
One-Way Mapping
• Your understanding of architecture will
change as you implement
– You will know more
– Your stakeholders will know more
– Changes to project (e.g. time, budget,
personnel)
• Faithful implementation is nearly
impossible
– Architectural drift
1/23/12
(C) USC-CSSE
12
University of Southern California
Center for Systems and Software Engineering
Two-Way Mapping
• Must understand how architecture and
implementation impact each other
– Design to implementation
– Implementation to design
• Two strategies
– Limit changes
– Change one, but require round-trip mapping
• Peer review is most effective
• Faithful to changes made
• Architecture is a living document
1/23/12
(C) USC-CSSE
13
University of Southern California
Center for Systems and Software Engineering
Outline
•
•
•
•
•
•
Faithful Implementation
Implementation Strategies
Mapping the Architecture
Middleware and Frameworks
Conclusion
A Technologist’s Perspective
1/23/12
(C) USC-CSSE
14
University of Southern California
Center for Systems and Software Engineering
Middleware
• Focus on services for developers to use
• Choosing middleware often impact
architecture substantially
• CORBA, PRISM
• In reality, middleware induces architecture
style
– CORBA induces the “distributed objects” style
– What does PRISM induce?
• Need to understand before going this route
1/23/12
(C) USC-CSSE
15
University of Southern California
Center for Systems and Software Engineering
Frameworks
• Focus on assisting developers in following a style
– Fill in the blanks
– Developers still have the power to violate the rules
• Generally considered as underlying infrastructures
– Do no typically show up in architectural designs (e.g.
components)
• Developing applications do not require a
framework
– What if developing multiple applications with a common
style?
– Following good software engineering practices, you
probably end up developing one
1/23/12
(C) USC-CSSE
16
University of Southern California
Center for Systems and Software Engineering
Middleware vs. Frameworks
• How to choose?
• Depends on the system you’re developing
• Consider the needs of application and
developers
– Common services utilized by most
components?
– Comply with stakeholders’ needs?
– Effectiveness and efficiency?
• Do web applications need middleware?
• What about frameworks?
1/23/12
(C) USC-CSSE
17
University of Southern California
Center for Systems and Software Engineering
Outline
•
•
•
•
•
•
Faithful Implementation
Implementation Strategies
Mapping the Architecture
Middleware and Frameworks
Conclusion
A Technologist’s Perspective
1/23/12
(C) USC-CSSE
18
University of Southern California
Center for Systems and Software Engineering
Implementation Strategies
•
•
•
•
•
Generative techniques
Frameworks
Middleware
Reuse-based techniques
Writing all code manually
1/23/12
(C) USC-CSSE
Normally impractical
Probably not looking hard enough
19
University of Southern California
Center for Systems and Software Engineering
Conclusion
• Faithful implementation is essential
– Mapping can be one-way or round-trip
– Round-trip mapping requires more, but avoid
architecture drift
• Middleware and frameworks imply an
architecture
– But do not define an architecture
– Choose your architecture first
• Not all frameworks are created equal
– Look for compliance level and ease of use
– Avoid unnecessary work
1/23/12
(C) USC-CSSE
20
University of Southern California
Center for Systems and Software Engineering
A Technologist’s Perspective
• http://oodt.jpl.nasa.gov/better-web-app.mov
• By Sean Kelly
– A JPL Technologist
– Discusses different web application
development frameworks
1/23/12
(C) USC-CSSE
21