Kĩ thuật lập trình - Chapter 1: Basic concepts in component - Based software engineering
Design patterns are widely used in the process of designing component-based systems in which the reusable units must be identified.
By using design patterns, it is easier to recognize those reusable parts and either find them in the form of pre-existing components, or develop them as reusable units.
28 trang |
Chia sẻ: huyhoang44 | Lượt xem: 675 | Lượt tải: 0
Bạn đang xem trước 20 trang tài liệu Kĩ thuật lập trình - Chapter 1: Basic concepts in component - Based software engineering, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
Chapter 1Basic Concepts in Component-Based Software Engineering Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringOverviewThe ComponentInterfacesContractsPatternsFrameworksRelationships between conceptsConclusionPage Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringWhat is a Component? We can find several definitions of a component in literature, however everyone agrees that a component is a piece of software. These definitions begin from the consideration of CBSE from different viewpoints and focus on different aspects of software engineering such as: Different phases (design, implementation and run-time phases),Business aspects,Architectural issues.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringThe Component: SzyperskiSzyperski defines a component precisely by enumerating its characteristic properties as follows: A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only.A software component can be deployed independently and is subject to composition by third party. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringImplications of Szyperski’s DefinitionThe following implications arise as a result of Szyperski’s definition:For a component to be deployed independently, a clear distinction from its environment and other components is required. A component must have clearly specified interfaces. The implementation must be encapsulated in the component and is not directly reachable from the environment .Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringThe Component: D'Souza and Wills D'Souza and Wills define a component as A reusable part of software, which is independently developed, and can be brought together with other components to build larger units. It may be adapted but may not be modified. A component can be, for example, a compiled code without a program source, or a part of a model and/or design. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringDescribing a ComponentTo be able to describe a component completely the component should consist of the following elements: A set of interfaces provided to, or required from the environment.An executable code, which can be coupled to the code of other components via interfaces.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringImproving a ComponentTo improve the component quality, the following elements can be included in the specification of a component:The specification of non-functional characteristics,The validation code,Additional information.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringObjects and ComponentsPfister and SzyperskiView a component as a collection of objects, in which the objects co-operate with each other, and are intertwined tightly. D'Souza and Wills Assert that if a class were packaged together with the explicitly defined interfaces which it requires and implements, then this class would be a component. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringObjects and Components ContinuedThe following are other important distinctions between objects and components:Components often use persistent storage whereas objects have local state. Components have a more extensive set of intercommunication mechanisms than objects which usually use the messaging mechanism. Components are often larger units of granularity than objects, and have complex actions at their interfaces.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringInterfacesAn interface of a component can be defined as a specification of its access point, offering no implementation for any of its operations.This seperation makes it possible to:Replace the implementation part without changing the interface;Add new interfaces (and implementations) without changing the existing implementation, Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringDescribing an InterfaceInterfaces defined in standard component technologies using techniques such as Interface Definition Language (IDL) are:Sufficient in describing functional properties.Insuffiecient in describing extra-functional properties such as quality attributes like accuracy, availability, latency, security, etc.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringExport and Import InterfacesWe can distinguish two kinds of interfaces. Components can export/import interfaces to/from environments which may include other components.An exported interface describes the services provided by a component to the environment.An imported interface specifies the services required by a component from the environment.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringContractsA more accurate specification of a component's behavior can be achieved through contracts. A contract is comprised of:The Invariant, the global constraints which the component will maintain; The Pre-condition, the constraints which need to be met by the client;The Post-condition, the constraints which the component promises to establish in return. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringHow Contracts specify Component InteractionA contract specifies the interactions among components, in terms of: The set of participating components;The role of each component through its contractual obligations, such as type and casual obligations; The invariant to be maintained by the components;The specification of the methods which instantiate the contract.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringPatternsPatterns define recurring solutions to recurring problems capturing non-obvious solutions, not just abstract principles or strategies. The solutions should be proven to solve the problem rather than being theories or speculations. Patterns describe relationships between deeper system structures and mechanism. A component, as a reusable entity, can be seen as a realization of some design pattern.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringThree Categories of PatternsPatterns can be classified into three major categories: Architectural Patterns, capture the overall structure and organization of a software system.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. Idioms, are low-level patterns which are dependent on the chosen paradigm and the programming language used.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringDesign PatternsDesign patterns are widely used in the process of designing component-based systems in which the reusable units must be identified. By using design patterns, it is easier to recognize those reusable parts and either find them in the form of pre-existing components, or develop them as reusable units. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringSoftware FrameworksCBSE means that we build software by "putting pieces together". Frameworks provide the context in which the pieces can be used.A framework may be seen as:A reusable design of a system, A skeleton of an application which can be customized by an application developer.Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringComponent FrameworksWhile 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..)ComponentFrameworkPage Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringComponent ModelsThe two concepts Component Models and Component Frameworks are sometimes intermixed. 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 modelPage Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringRelationships Between ConceptsInterface that satisfies contractsComponent implementationComponent modelIndependent deploymentComponent-typeSpecific interfaceCoordination Services (transactions, persistence..)ComponentFrameworkPage Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringFrameworks and ContractsFrameworks amd ComponentsBy 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. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringFrameworks and Contracts ContinuedFrameworks and ContractsFrameworks focus on the overall properties of component compositions. Contracts give specifications for relationships between concrete components. These specifications may be different for components within one composition. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringFrameworks and PatternsIt is important to realize that design patterns and frameworks are distinct concepts of different natures. Design patterns are of a logical nature, representing knowledge of and experience gained with software.Frameworks are of a physical nature, and are executable software used in either the design or the run-time phase. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringFrameworks and Patterns ContinuedThe major differences between design patterns and frameworks are as follows:The level of abstraction of frameworks and design patterns;Design patterns are smaller architectural elements than frameworks;The level of specialization of frameworks and design patterns. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringConclusionComponent specifications are essential for component users who are focused on the component features, functional and non-functional The main purpose of frameworks is to support the process of component composition 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. Page Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software EngineeringConclusion ContinuedPatterns give an abstract and more general view of a function, procedure or similar, which can be implemented in the form of systems or components Component designers will use patterns in the design process to design components more efficientlyPage Building Reliable Component-based Systems Chapter 1 - Basic Concepts in Component-Based Software Engineering
Các file đính kèm theo tài liệu này:
- 01_chapterwc_4788.ppt