1 / 156

The Role of Architecture in Understanding Software

The Role of Architecture in Understanding Software. Rick Kazman Hausi Müller Jeromy Carrière. Software Architecture: What is it and How to Represent It. Rick Kazman kazman@sei.cmu.edu www.sei.cmu.edu/staff/rkazman. Control process (CP). Prop loss model (MODP). Reverb model (MODR).

derex
Télécharger la présentation

The Role of Architecture in Understanding Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Role of Architecture • in Understanding Software Rick KazmanHausi MüllerJeromy Carrière

  2. Software Architecture: • What is it and How to Represent It Rick Kazman kazman@sei.cmu.edu www.sei.cmu.edu/staff/rkazman

  3. Control process (CP) Prop loss model (MODP) Reverb model (MODR) Noise model (MODN) A Software Architecture (?)

  4. What is Wrong with this Diagram? • Many things are left unspecified: • What kind of components? • What kind of connectors? • What do the boxes and arrows mean? • What is the significance of the layout? • Why is control process on a higher level? • Box and arrow drawings alone are not architectures; rather, they are a starting point.

  5. What’s Wrong with the Diagram? • Which structure? Software is composed of many structures. • modules • tasks • functions • hardware • classes • Thus, when seeing boxes and lines, we must ask • What do the boxes represent? • What do the arrows mean?

  6. What is Software Architecture? • The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships among them.

  7. Implications of this Definition • Architecture is an abstraction of systems. • Architecture defines components and how they interact. • Architecture suppresses purely local information; private component details are not architectural. • Systems have many structures (views). • No single view can be the architecture. • The set of candidate views is not fixed or prescribed: whatever is useful for analysis or communication.

  8. More Implications • Every system has an architecture. • Every system is composed of components and relationships among them. • In the simplest case, a system is composed of a single component, related only to itself. • Having an architecture is different from having an architecture that is known. Issues: • precise specification of the architecture • architecture recovery and conformance • rationale for the architecture

  9. Why Is Architecture Important? • Architecture is important for (at least) three reasons. • It provides a vehicle for communication among stakeholders. • It is the manifestation of the earliest designdecisions about a system. • It is a transferable, reusable abstraction of asystem.

  10. Communication Vehicle • Architecture provides a common frame of reference in which competing interests may be exposed and negotiated. • negotiating requirements with users • keeping the customer informed of progress and cost • implementing management decisions and allocations

  11. Result of Early Design Decisions -1 • An architecture constrains an implementation. • implementations must conform to architecture • (global) resource allocation decisions constrain implementations of individual components • system tradeoffs are manifested in the architecture

  12. Result of Early Design Decisions -2 • The architecture dictates organizational structure for development/maintenance efforts, e.g. • division into teams • units for budgeting, planning • basis of work breakdown structure • organization for documentation • organization for CM libraries • basis of integration, test plans, testing • basis of maintenance •  Once committed to, an architecture is extremely hard to change!

  13. Result of Early Design Decisions-3. • Architecture permits/precludes the achievement of a system’s desired quality attributes (modifiability, performance, security, etc.). • The architecture influences qualities, but does not guarantee them. • An architecture helps with evolutionary prototyping. • Architecture serves as a skeletal framework into which components can be plugged. • By segregating functionality into appropriate components, experimentation is easier.

  14. Reusable Model • An architecture forms a reusable model. It: • provides a vocabulary of design • enables template-based component development • enables product lines • enables systems to be built from externally developed components • separates functionality from packaging and interconnection mechanisms

  15. Architectural Structures - 1 • In a house, there are plans for rooms, electrical wiring, plumbing, ventilation, . . . • Each of these constitutes a “view” of the house. These views are • used by different people • used to achieve different qualities in the house • used as a description and prescription • So it is with software architecture.

  16. Develop- ment Functional Code Scenarios Concurrency Physical Architectural Structures - 2.  Similar to Kruchten’s 4+1 View Model

  17. Functional View • Components: • functions, key system abstractions, domain elements • Connectors: • dependencies, data flow • Users: • domain engineers, product-line designers, end users • Reasoning: • functionality, modifiability, product lines/reusability, tool support, work allocation

  18. Functional View Example

  19. Code View • Components: • classes, objects, procedures, functions • subsystems, layers, modules • Connectors: • calls, invokes • is-a-sub-module-of • Users: • programmers, designers, reusers • Reasoning: • modifiability/maintainability, portability, subsetability

  20. MotifWindowKit CreateScrollBar() CreateWindow() Code View Example WindowKit CreateScrollBar() CreateWindow() OpenLookWindowKit return CreateScrollBar() new OpenLookWindow CreateWindow() return new MotifWindow

  21. Development View • Components: • files, directories • Connectors: • contains • Users: • managers, programmers, configuration managers • Reasoning: • modifiability/maintainability • testing • configuration management/version control

  22. Development View Example

  23. Concurrency View • Components: • processes, threads • Connectors: • synchronization, data flow, events • Users: • performance engineers, integrators, testers • Reasoning: • performance, availability

  24. Concurrency View Example

  25. Physical View • Components: • CPUs, sensors, storage • Connectors: • networks, communication devices • Users: • hardware engineers, system engineers • Reasoning: • system delivery and installation, performance, availability, scalability, security

  26. Physical View Example

  27. Scenarios • What are scenarios? • use cases: sequences of responsibilities • change cases: changes to the system • Why use scenarios? • to understand and validate the design • to communicate the design • to tie the views together • to animate the design • to understand the limits of the design

  28. What Are Views Used For? • Each view provides an engineering handle on certain quality attributes. • Views are an engineering tool to help achieve desired system qualities. • In some systems, distinct views collapse into one. (E.g., the concurrency and physical views may be the same for small systems.)

  29. What Are Views Used For? • Documentation vehicle for • current development and future development • managers and customers • Thus, views must be annotated to support analysis. • Scenarios aid in annotating views with design rationale.

  30. Hierarchical Views • Every view is potentially hierarchical, e.g.: • functional: functions contain sub-functions • development: directories contain files • code: modules contain sub-modules; systems contain sub-systems • concurrency: processes contain threads • physical: clusters contain computers contain processors • Because views are complex and hierarchical, they need to be navigable.

  31. View Navigability - 1 • A skilled software engineer with some domain knowledge should be able to read the documentation and navigate through it. • There should be an obvious starting point, portraying the system as a collection of interconnected subsystems. • Subsystems should be named, with their responsibilities, functionality, and interconnections identified.

  32. View Navigability - 2. • Pointers should direct the reader to more detailed documentation of sub-structures. • Tool support can and should aid in navigation. • At every stage, the nature of the connections among the parts should be clearly identified.

  33. Architectural Representation Summary • Architectural views are related to each other in complicated ways. • Lesson: Choose the views that are useful to the system being built and to the achievement of qualities that are important to you. • The architectural views should be hierarchical (where needed) and navigable. • The views should contain enough annotated information to support desired analyses.

  34. Part IISoftware ArchitecturePatterns and AntiPatterns • Hausi A. Müller

  35. Outline • Architecture Patterns • Motivation • Software patterns • Pattern formats • Shaw’s architecture patterns • Qualities of a pattern • Architecture AntiPatterns

  36. Motivation • Vehicle for reasoning about design or architecture at a higher level of abstraction • gain design confidence • Mining design patterns in legacy systems • identify product lines • Software architecture • dissemination of good design, design reuse • Engineering Handbooks • contain a wealth of experience

  37. Software Patterns • Programming patterns or idioms [Coplien95] • Programming language specific • Design patterns [GoF95] • Class and object level • Creational, structural, behavioral • Architectural patterns [Shaw95] • Subsystem level • Pattern languages [Coplien95, Vlissides96] • All levels • Reflective patterns [Buschmann95] • Metaprogramming

  38. Software Patterns ... • Analysis patterns [Fowler97] • AntiPatterns [Brown98] • Frameworks • STL (C++ Template Library) • Algorithms and data structures • Conceptual patterns • Generative patterns • Organizational patterns

  39. Pattern Definitions • A pattern is a named nugget of insight that conveys the essence of a proven solution to a recurring problem within a certain context amidst competing concerns • A pattern is the abstraction from a concrete form which keeps recurring in specific non-arbitrary contexts.

  40. Pattern Definitions ... • Description of communicating objects and classes that are customized to solve a general design in a particular context [GoF95]. • Design patterns capture the static and dynamic structures of solutions that occur repeatedly when producing applications in a particular context [Coplien95].

  41. Historical Perspective • 1979 • Alexander’s Timeless Way of Building • 1987 • OOPSLA workshop by Beck & Ward • 1994 • First PLoP (Pattern Languages on Programming) conference • 1995 • GoF (Gamma, Helm, Johnson, Vlissides) • Design Patterns; Elements of Reusable Object-Oriented Software

  42. A Good Pattern • It solves a problem • Patterns capture solutions, not just abstract principles or strategies • It is a proven concept • Patterns capture solutions with a track record, not theories or speculation • The solution isn’t obvious • The best patterns generate a solution indirectly; normal for many design problems

  43. A Good Pattern ... • It describes a relationship • Patterns describe more than black boxes: system structures and mechanisms • The pattern has a significant human component • The best patterns explicitly appeal to aesthetics and utility

  44. Pattern Formats • Alexandrian form (canonical form) • GoF format [GoF95] • Shaw’s format [Shaw94] • Essential components of a pattern format • Name, problem, context, forces • Solution, examples, context, • Rationale, related patterns, known uses

  45. Canonical Pattern Format ... • Name • meaningful phrase • Problem • a statement of the problem which describes its intent: the goals and objectives it wants to reach within the given context and forces

  46. Canonical Pattern Format ... • Context • preconditions under which the problem and its solutions seem to occur • the pattern’s applicability • may change over time • Forces • relevant forces and constraints and their interactions and conflicts • motivational scenario for the pattern

  47. Canonical Pattern Format ... • Solution • Static and dynamic relationships describing how to realize the pattern • instructions on how to construct the work products • pictures, diagrams, prose which highlight the pattern’s structure, participants, and collaborations

  48. Canonical Pattern Format ... • Examples • one or more sample applications to illustrate • a specific context • how the pattern is applied • Resulting context • the state or configuration after the pattern has been applied • consequences (good and bad) of applying the pattern

  49. Canonical Pattern Format ... • Rationale • justification of the steps or rules in the pattern • how and why it resolves the forces to achieve the desired goals, principles, and philosophies • how are the forces orchestrated to achieve harmony • how does the pattern actually work

  50. Canonical Pattern Format ... • Related patterns • the static and dynamic relationships between this pattern and other patterns • Known uses • to demonstrate that this is a proven solution to a recurring problem

More Related