ARCHITECTURAL DESIGN
Objective: Architectural design tools model the overall software structure by representing component interfaces, dependencies and relationships, and interactions.
Mechanics: Tools mechanics vary. In most cases, architectural design capability is part of the functionality provided by automated tools for analysis and design modeling.
Representative Tools:
Adalon, developed by Synthis Corp. (www.synthis.com), is a specialized design tool for the design and construction of specific Web-based component architectures.
ObjectiF, developed mico Tools GmbH (www.microtool.com), is a UML-based design tool that leads to architectures (e.g., Coldfusion, j2EE, Fusebox) amenable to component- based software engineering.
Rational Rose, developed by Rational (www.ra is a UML- based design tool that support all aspects of architectural design).
Pattern–Based Software Design:
The best designers in any field have an uncanny ability to see patterns that characterize a problem and corresponding patterns that can be combined to create a solution. Throughout the design process, a software engineer should look for every opportunity to reuse existing design patterns (when they meet the needs of the design) rather than creating new ones.
Describing a Design Pattern
Mature engineering disciplines make use of thousands of design patterns, For example, a mechanical engineer uses a two- step, keyed shaft as a design pattern. Inherent in the pattern are attributes (the diameters of the shaft, the dimensions of the keyway, etc.) and operations (e.g., shaft rotation, shaft connection). An electrical engineer uses an integrated circuit (an extremely complex design pattern) to solve a specific element of a new problem. Design patterns may be described using the template shown in the sidebar.
Design Pattern Template:
Pattern name describes the essence of the pattern in a short but expressive name.
Intent - describes the pattern and what it does.
Also - known - as - lists any synonyms for the pattern.
Motivation - provides an example of the problem.
Applicability – notes specific design situations in which the pattern is applicable.
Structure - describes the responsibilities of the classes that are required to implement the pattern.
Participants - describes the responsibilities of the classes that are required to implement the pattern.
Collaborations - describes the responsibilities of the classes that are required to implement the pattern.
Collaborations – describes how the participants collaborate to carry out their responsibilities.
Consequences - describes the “design forces” that affect the pattern and the potential trade- offs that must be considered when the pattern is implemented.
Related Patterns - cross- references related design patterns.
A description of the design pattern may also consider a set of design forces. Design forces describe non- functional requirements (e.g., ease of maintainability, portability) associated with the software for which the pattern is to applied. In addition forces define the constraints that may restrict the manner in which the design is to be implemented. In essence, design forces describe the environment and conditions that must exist to make the design pattern applicable. The pattern characteristics (classes, responsibilities, and collaborations) indicate the attributes of the design that may be adjusted to enable the pattern to accommodate a variety of problems. These attributes represent characteristics of the design that can be searched (e.g., via a database) so that an appropriate pattern can be found. Finally, guidance associated with the use of a design pattern provides an indication of the ramifications of design decisions.
Martin Fowler “patterns are half- baked—meaning you always have to finish them yourself and adapt them to your own environment.”
The names of design patterns should be chosen with care. One of the key technical problems in software reuse is the inability to find existing reusable patterns when hundreds or thousands of candidate pattern exist. The search for the “right” pattern is aided immeasurably by a meaningful pattern name.
Using Patterns in design
Design patterns can be used throughout software design. Once the analysis model has been developed, the designer can examine a detailed representation of the problem to be solved and the constraints that are imposed by the problem. The problem description is examined at various levels of abstraction to determine if it is amenable to one or more of the following types of design patterns:
Architectural patterns: These patterns define the overall structure of the software and indicate the relationship among subsystems and software components, and ages, components, subsystems) of the architecture.
Design patterns: These patterns address a specific element of the design such as an aggregation of components to solve some design problem, among components, or the mechanisms of effecting components-to-components communications.
Idioms: Sometimes called coding patterns, these language – specific patterns generally implement an algorithmic element of a component, a specific protocol, or a mechanism for communication among components.
Each of these pattern types differs in the level of abstraction with which it is represented and the degree to which it provides direct guidance for the construction activity ( in this case, coding) of the software process.
Frameworks:
In some cases it may be necessary to provide an implementation- specific skeletal infrastructure, called a framework, for design work. That is, the designer may select a “reusable mini- architecture that provides the generic structure and behavior for a family of software abstractions, along with a context… which specifies their collaboration and use within domain.”
A framework is not an architectural pattern, but rather a skeleton with a collection with a collection of “plug points” (also called hooks and slots) that enables it to be adapted to specific classes or functionality within the skeleton. In an object- oriented context, a framework is a collection of cooperating classes.
In essence, the designer of a framework will argue that one reusable mini – architecture is applicable to all software to be developed within a limited domain of application. To be most effective, frameworks are applied with no changes. Additional design elements may be added, but only via the plug points that allow the designer to flush out the framework skeleton.
Design engineering commences, as the first iteration of requirements engineering comes to a conclusion. The intent of software design is to apply a set of principles, concepts, and practices that lead to the development of a high- quality system or product. The goal design is to create a model of software that will implement all customer requirements correctly and bring delight to those who use it. Design engineers must shift through many design alternatives and coverage on a solution that best suits the needs of project stakeholders.
The design process moves from a “big picture” view of software to a more narrow view that defines the details required to implement a system. The process begins by focusing on architecture. Subsystems are defined; communication mechanisms among subsystems are established; components are identified; and a detailed description of each component is developed. In addition, external, internal, and user interfaces are designed.
Design concepts have evolved over the first half-century of software engineering work. They describe attributes of computer software that should be present regardless of the software engineering process that is chosen, the design methods that are applied, or the programming languages that are used.
The design model encompasses four different elements. As each of these elements is developed, a more complete view of the design evolves. The architectural elements used information derived from the application domain, the analysis model, and available catalogs for patterns and styles to derive a complete structural representation of the software, its subsystems and components. Interface design elements model external and internal interfaces and the user interface. Component- level elements define each of the modules (components) that populates the architecture. Finally, deployment- level design elements allocate the architecture, its components, and the interfaces to the physical configuration that will house the software.
Pattern- based design is a technique that ruses design elements that have proven successful in the past. Each architectural pattern, design pattern, or idiom is cataloged, thoroughly documented, and carefully considered as it assessed for inclusion in a specific application. Frameworks, an extension of patterns, provide an architectural skeleton for the design of complete subsystems within a specific application domain.
Alternative Designs
Design results in a number of architectural alternatives that are accessed to determine which is most appropriate for the problem to be solved. In the section that follow, we consider the assessment of alternative architectural designs.
a) An architecture Trade- off Analysis Method
The architecture trade- off analysis method establishes an iterative evaluation process for software architecture. The design analysis activities that follow are performed iteratively.
1. Collect scenarios. A set of use- cases is developed to represent the system from the user’s point of view.
2. Elicit requirements, constraints, and environment description. This information is a requirement as part of requirement engineering and is used to feel certain that all stakeholder concerns have been addressed.
3. Describe the architectural styles/ patterns that have chosen to scenarios and requirements.
4. Evaluate quality attributes by considering each attribute in isolation. Quality attributes for architectural design assessment include reliability, performance, Security, maintainability, flexibility, testability, portability, reusability, and interoperability.
5. Identify the sensitivity of quality attributes to various architectural attributes for a specific architectural style.
6. Critique candidate architectures (developed in steep3) using the sensitivity analysis conducted in step 5.
b) Architectural Complexity
A useful technique for assessing the overall complexity of proposed architecture is to consider long tendencies between components within the architecture. These dependencies are driven by information/ control flow within the system and the types of dependencies.
Sharing dependencies represent dependence relationships among consumers who use the same resource or producers who produce for the same consumers.
Flow dependencies represent dependences relationship between producers and consumers of resource or producers who produce for the same consumers.
Constrained dependencies represent constraints on the relative flow of control among a set of activities.
Mapping Data Flow Into a Software Architecture
To illustrate one approach to architectural mapping we consider a mapping technique for the call and return architectures from data flow diagrams within the analysis model.
a) Transform Flow
Information must enter and exit software in an “external world” form. Information enters the system along paths that transforms external data in to an internal form.
Incoming data are passed through a transform center and the data begin to move along paths that lead “out” of the software. Data moving along these paths are called out—going flow. The overall flow of data occurs in a sequential manner and follows one another. Only in a few of these characteristics, transform flow is present.
b) Transaction Flow
Information flow is often characterized by a single data item, called a transaction that triggers other data flow one of many paths. When a DFD takes the form shown in 4.8 transaction flow is present.
Transaction flow is characterized by data moving along an incoming path that converts external world information into a transaction that is evaluated and based on its value the flow one of many action paths emanate is called a transaction center.
c) Transform Mapping
Transform mapping is a set of design steps that allows DFD. It transforms flow characteristics to be mapped into a specific architectural style. To illustrate this application approach, we consider the Safe Home security function. To map these data flow diagram into an architecture the following design steps are initiated:
Step 1. Review the fundamental system model. Fundamental system model or context diagram depicts the security function as a single transforming representing the external producer and consumer of data that flow into and out of the function.
Step 2. Review and refine data flow diagrams for the software. B Information obtained from the analysis model is refined to produce greater detail.
Step 3. Determine whether the DFD has transform or transaction flow characteristics. In general, information flow with in a system can also be represented as transform. However, when an obvious transaction characteristic is encountered, a different design mapping is recommended. In this step, the designer selects global (software-wide) flow characteristics based on a prevailing nature of the DFD. In addition, reasons of transform for transaction flow are isolated. These sub flows can be used to refine program architecture derived from a global characteristic described previously.
Step 4. Isolate the transform center by specifying incoming and outgoing flow boundaries. In the proceeding section incoming flow was described as a path that converts information from external to internal form; outgoing flow converts internal forms to external form. Incoming and outgoing flow boundaries are open to interpretation. That is, different designers may select slightly different points in the flow as boundary location.
Step 5. Perform “first- level factoring.” The program architecture derived using this mapping results in a top- down distribution of control. Factoring results in a program structure in which top-level components perform most input, computation and output work. Middle-level components perform some control and do moderate amounts of work.
Step 6. Perform “second – level factoring.” Second- level factoring is accomplished by mapping individual transforms (bubbles) of a DFD into appropriate modules within the architecture. Beginning at the transform center boundary and moving outward along incoming and then outgoing paths, transform centers are mapped into sub-coordinate levels of software structure.
Step 7. Refine the first- iteration architecture using design heuristics for improved software quality. First – iteration architecture can always be refined by applying concepts of functional independence. Components are exploded or imploded to produce sensible factoring, good cohesion, minimal coupling and most importantly, a structure that can be implemented without difficulty, tested without confusion, and maintained without grief.
Transaction Mapping
In this section we consider design steps used to map transaction flow into software architecture.
Transaction mapping will be illustrated by considering the user interaction subsystem of the SafeHome security function. Refining the flow. The data object User commands, flow into the system and result in additional information flow along one of three actions path. A single data item, command type, causes the data flow to fan outward from a hub. Therefore, the overall data flow characteristic is transaction oriented.
The design steps for transaction mapping are similar and in some cases identical to steps for transform mapping.
Modeling Component-Level Design
(i) Class Base Component
In the context of object- oriented software engineering, a component contains a set of collaborating classes. Each class within a component has been fully elaborated to include all attributes and operations that are relevant to its implementation. As part of the design elaboration. As part of the design elaboration, all interfaces (messages) that enable the classes to communicate and collaborate with other design classes must also be defined. To accomplish this, the designer begins with analysis model and elaborate analysis classes (for components that relate to the problem domain) and infrastructure classes (for components that provide support services for the problem domain).
(ii) Component – Level Design Guidelines
The guidelines are
Components
Naming conventions should be established for components that are specified as part of the architectural model and then refined and elaborated as part of the component- level model. Architectural component names should be drawn from the problem domain and should have meaning to all stakeholders who view the architectural model.
Interfaces
Interfaces provide important information about communication and collaboration. Ambler recommends that (1) lollipop representation of an interface should be used in lieu of the more formal UML box and dashed arrow approach, when diagram grows complex; (2) for consistency, interfaces should flow from the left-hand side of the component box; (3) only those interfaces that are relevant to the component under consideration should be shown, even if other interfaces are available. These recommendations are intended to simplify the visual nature of UML component diagram.
Dependencies and inheritance.
For improved readability, it is a good idea to model dependencies from left to right and inheritance from bottom (derived classes) to top (base classes). In addition, component- to component dependency.
(iii) Conducting Component-Level Design
The designer must transform information from the analysis and architectural models into a design representation that provides sufficient detail to guide thee construction (coding and testing) activity. The following steps represent a typical task set for component-level design, when it is applied for an object –oriented system.
Step 1. Identity all design classes that correspond to the problem domain.
Using the analysis and architectural models, each analysis class and architectural component are elaborated.
Step 2. Identify all design classes that correspond to the infrastructure domain.
Step 3. Elaborate all design classes that are not acquired as reusable components.
Elaboration requires that all interfaces, attributes, and operations necessary to implement the class be described in detail.
a. Specify message details when classes or components collaborate.
The analysis model makes use of a collaboration diagram to show how analysis classes collaborate with one another. As component- level design proceeds, it is sometimes useful to show the details of these collaborations by specifying the structure of message that are passed between objects within a system. Although this design is optional, it can be used as a precursor to thee specification of interfaces that show how components within the system communicate and collaborate.
b. Identify appropriate interfaces for each component. Within the context of component- level design, a UML interface is “a group of externally visible operations.”
c. Elaborate attributes and define data types and data structures required to implement them. Data structures and types used to describe attributes are defined within the context of the programming language that is to be used.
d. Describe proceeding flow within each operation in detail. This may be accomplished using a programming language- based pseudo code or with a UML activity diagram each software component is elaborated through a number of iterations that apply the stepwise refinement concept.
Step 4. Develop and elaborate behavioral representations for a class or component. UML state diagrams were used as part of the analysis model to resent the externally observable behavior of the system and more localized behavior of individual analysis classes. During component- level- design, it is sometimes necessary to model the behavior of a design class.
The dynamic behavior of an object is affected by events that are external to it and the current state of the object. To understand the dynamic behavior of an object, the designer must examine all use cases that are relevant to the design class throughout its life. These use – cases provide information that helps the designer to delineate the event that affects the object and the stats in which the object resides as time passes and events occur.
Step 6. Elaborate deployment diagrams to provide additional detail. During component—level design, deployment diagram can be elaborated to represent the location of key packages of components. However, components generally are not represented individually within a component diagram. The reason for this is to avoid diagrammatic complexity.
Step 7. Factor every component- level design representation and always consider alternatives.