How Contracts specify Component Interaction q A contract














- Slides: 14
How Contracts specify Component Interaction q A contract specifies the interactions among components, in terms of: l The set of participating components; l The role of each component through its contractual obligations, such as type and casual obligations; l The invariant to be maintained by the components; l The specification of the methods which instantiate the contract. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 1
Patterns q Patterns define recurring solutions to recurring problems capturing non-obvious solutions, not just abstract principles or strategies. l The solutions should be proven to solve the problem rather than being theories or speculations. l Patterns describe relationships between deeper system structures and mechanism. l A component, as a reusable entity, can be seen as a realization of some design pattern. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 2
Three Categories of Patterns q Patterns can be classified into three major categories: l Architectural Patterns, capture the overall structure and organization of a software system. l Design Patterns, refine the structure and the behavior of the subsystems as well as the components of a software system, and the relationships which exist between them. l Idioms, are low-level patterns which are dependent on the chosen paradigm and the programming language used. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 3
Design Patterns q Design patterns are widely used in the process of designing component-based systems in which the reusable units must be identified. q By using design patterns, it is easier to recognize those reusable parts and either find them in the form of preexisting components, or develop them as reusable units. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 4
Software Frameworks q CBSE means that we build software by "putting pieces together". Frameworks provide the context in which the pieces can be used. q A framework may be seen as: l A reusable design of a system, l A skeleton of an application which can be customized by an application developer. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 5
Component Frameworks q While frameworks in general describe a typical and reusable situation at a model level, a component framework describes a “circuit-board” with empty slots into which components can be inserted to create a working instance. Coordination Services (transactions, persistence. . ) Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Component Framework Page 6
Component Models q The two concepts Component Models and Component Frameworks are sometimes intermixed. q A component model defines a set of standards and conventions used by the component developer whereas a component framework is a support infrastructure for the component model. Component model Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 7
Relationships Between Concepts Interface that satisfies contracts Component-type Specific interface Independent deployment Coordination Services (transactions, persistence. . ) Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Component implementation Component model Component Framework Page 8
Frameworks and Contracts q Frameworks amd Components l By the definition of frameworks as described earlier, a framework can be seen as a circuit-board (component framework) that is instantiated by filling in the empty slots. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 9
Frameworks and Contracts Continued q Frameworks and Contracts l Frameworks focus on the overall properties of component compositions. l Contracts give specifications for relationships between concrete components. These specifications may be different for components within one composition. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 10
Frameworks and Patterns q It is important to realize that design patterns and frameworks are distinct concepts of different natures. l Design patterns are of a logical nature, representing knowledge of and experience gained with software. l Frameworks are of a physical nature, and are executable software used in either the design or the runtime phase. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 11
Frameworks and Patterns Continued q The major differences between design patterns and frameworks are as follows: l The level of abstraction of frameworks and design patterns; l Design patterns are smaller architectural elements than frameworks; l The level of specialization of frameworks and design patterns. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 12
Conclusion q Component specifications are essential for component users who are focused on the component features, functional and non-functional q The main purpose of frameworks is to support the process of component composition q Component developers must obey the rules and formats specified by the framework to develop and to specify the component, while component users will use frameworks to compose systems from components in a more efficient and accurate way. Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 13
Conclusion Continued q Patterns give an abstract and more general view of a function, procedure or similar, which can be implemented in the form of systems or components q Component designers will use patterns in the design process to design components more efficiently Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Page 14