Generalization and Instantiation for Component Reuse

نویسندگان

  • Samira Sadaoui
  • Pengzhou Yin
چکیده

ion high low medium Source component fixed/parameterized fixed/parameterized parameterized Set of constraints in empty not empty loosed formal parameter consists of defining the properties of holes, which are kept in the equations of formal parameters. Formally, we regard the process of making holes without properties as syntactic generalization, with properties as semantic generalization, and the process of altering the properties of holes as formal parameter generalization. We also note that the fixed/parameterized components refer to the boards without/with holes. The three types of generalization are defined below and compared in Table 1: • Syntactic generalization does not preserve the properties of the formal parameter (unconstrained genericity) [24]. After syntactic generalization, the equation part of the formal parameter is empty (as shown in the parameter ELEMENT of Fig. 1). • Semantic generalization preserves the constraints of the formal parameter (constrained genericity) [24]. After semantic generalization, the equation part of the formal parameter cannot be empty. In programming languages, genericity with constraints is not supported. • Formal parameter generalization loses some of the semantics of the formal parameter. Its source component is already a parameterized component. Generalizing a data type consists of replacing some of its auxiliary types by formal parameters. First, we have to decide which auxiliary sorts and which local operations are appropriate for a good generalization [22, 24]. The goal here is to avoid over-generalization which creates general components that are hard to understand and reuse. Our generalization is conducted in an incremental way, which means that we generalize only one auxiliary data type each time. Below we give the general definition of the generalization operation where COM and COM ] denote respectively the specific component and the general adaptable one, and sorts a function which returns all the sorts of a specification. Definition 3 (Generalization Operation). Generalization, a transformation operation, is defined as a specification morphism g : COM ] → COM where • COM ] can be used in more contexts than COM, i.e. COM ] has more formal parameters than COM or the semantics of the formal parameters in COM ] is loosened further. • g the signature morphism is defined as: — g : sorts(COM ) → sorts(COM) — g : LocalOpn → LocalOpn — g : LocalEqn → LocalEqn April 13, 2006 9:47 WSPC/117-ijseke 00276 180 S. Sadaoui & P. Yin • there must exist an instantiation of COM ] that is isomorphic to COM. To make the introduction of the generalization algorithms easier, we give the following definitions: • Source auxiliary data type, AuxDT, is present in the profile of COM’s constructors but cannot be the sort of interest. • Source operations, LOpn ⊆ LocalOpn, is the subset of non-constructors in COM containing AuxDT in their profiles. However, LOpn includes only the operations where AuxDT is referred to as the internal element of the structure COM. This restriction prevent over-generalization of COM. As an example, in the operation “get : list, position → natural”, the range natural is referred to as the element of the list while in the operation “length : list → natural”, natural is only used as a counter. The generalization of get is worthy but the one of length is useless. • Source equations, LEqn ⊆ LocalEqn, is the set of corresponding equations of LOpn. • sorti, sorts, nconsts, eqns are functions which return respectively the sort of interest, the set of all sorts, the set of non-constructors and the set of equations for a given data type, and card returns the cardinality of a set. • Source auxiliary operations, OpnAuxDT⊆ nconsts(AuxDT), is the set of operations defined in AuxDT and used by LEqn. • Formal parameter, FormalP, is a data type specifying the formal sort belonging to the profile of COM ’s constructors. 3.1. Syntactic generalization Sometimes syntactic generalization is too strong because we lose all semantics of the formal parameter. However, it serves as a starting point for semantic generalization. One problem with generalization is how to preserve the “meaning” of the operations in source components, i.e. how to control the level of abstraction so that we can keep the behaviors of components unchanged. Highly specific components have little chance of being reused. Meanwhile, if a component is too general, its reuse might be also hard. The aim of doing the meaning preserving generalization is to narrow down the generality of generic components. There are two main categories of operations in algebraic specifications: constructors and non-constructors. Their meaning are also presented in two different ways: • The meaning of constructors is the pattern of their profiles. For example, the profile of the constructor succ in NATURAL is: natural → natural, i.e. from a given number we can get the next one. The data type created by such kind of constructor is linear order because its ground terms are sequential starting from the first element. • The meaning of non-constructors are defined by their relationships with the constructor. For example, the same operation “+” has different forms of definition along with different formats of constructors. April 13, 2006 9:47 WSPC/117-ijseke 00276 Generalization and Instantiation for Component Reuse 181 Table 2. Operations with the same meaning. Meaning Data type Symbol of operation Adding Linear order + Container set ∪ Container list merge Removing Linear order — Container set — Container queue dequeue Container stack pop Container table remove The symbols of operations also reflect their meaning. For instance, “+” in NATURAL means adding variables, so does the operation “∪” in data type SET. However “—” means separating one from another. In table 2, examples of typical operations with the same meaning are listed. The algorithm of syntactic generalization is syntax-directed conversion: an auxiliary sort is replaced by a formal parameter whose definition is added in the resulting specification. To ensure the proper input, some pre-conditions are defined. After generalization, several requirements defined as post-conditions are met by COM ] to ensure its correctness. Profile: COM ] = generalize COM through AuxDT by FormalP where • COM is the component to be generalized. • AuxDT is the name of the auxiliary data type to be abstracted. • FormalP is the name of the formal parameter replacing AuxDT . • COM ] is the resulting generic component.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Using Viewpoints , Frameworks , and Domain - Specific Languages to Enhance Software Reuse

Case studies have shown that high levels of software reuse can be achieved through the use of object-oriented frameworks. This paper describes a viewpoint-based design and instantiation method for framework development. This method uses the concept of viewpoints and the hot-spot relation in object-oriented design to guide the designer on the identification of hot-spots in the structure of the f...

متن کامل

Component-based product line development: the KobrA Approach

The product line and component-based approaches to software engineering both hold the potential to significantly increase the level of reuse in industrial software development and maintenance. They also have complementary strengths, since they address the problem of reuse at opposite ends of the granularity spectrum product line development essentially supports "reuse in the large" while compon...

متن کامل

An Approach of Reuse-based Software Process Improvement

This paper puts forward a novel approach of applying process reuse technology to implement software process improvement and control. A united framework of reuse-based software process improvement is proposed, which integrates the model-driven process improvement (Top-down) with measurement-driven process improvement (Bottom-up). The method of component-based software process instantiation and a...

متن کامل

Customizable Domain Analysis

Generative and Component-Based Software Engineering are approaches to reuse. Within both approaches the scope of reuse can vary between general purpose and application specific. We argue for scoping the reusable assets based on a product line. Domain analysis methods provide processes for determining the common and varying requirements for a product line. However, we experienced that existing m...

متن کامل

Enabling reuse with a configuration language

Organized reuse of software components have been employed for several decades in Garex, a Norwegian company producing customized voice communication control switch systems. Through a process encouraging reuse a large number of highly parameterized components have been crafted. However, the current manual approach to instantiating and connecting components is very complex and time consuming, and...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • International Journal of Software Engineering and Knowledge Engineering

دوره 16  شماره 

صفحات  -

تاریخ انتشار 2006