US20090077511A1 - Generating Constraints in a Class Model - Google Patents
Generating Constraints in a Class Model Download PDFInfo
- Publication number
- US20090077511A1 US20090077511A1 US12/201,828 US20182808A US2009077511A1 US 20090077511 A1 US20090077511 A1 US 20090077511A1 US 20182808 A US20182808 A US 20182808A US 2009077511 A1 US2009077511 A1 US 2009077511A1
- Authority
- US
- United States
- Prior art keywords
- constraint
- patterns
- pattern
- class model
- elements
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/10—Requirements analysis; Specification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
Definitions
- the invention relates to a method, computer program product and data processing system for generating code from a class model.
- Modeling languages such as the unified modeling language provide a variety of model types for describing properties of a modeled system.
- a class model models the underlying data model of a system in an object oriented manner.
- a class model specifies elements of modeling languages and dependencies between the elements. Class models have diagrammatic syntax and therefore allow people without skills in computer science to model data.
- FIG. 1 shows a flow diagram illustrating the steps involved in the state of the art development process 100 .
- a model is created. This can be performed graphically by a model developer.
- constraints are added to the model. The step 104 is carried out by a constraints expert.
- the constraints are checked for correct syntax and types. If the checks are not passed in a step 108 , the constraints are refined in a step 110 and potentially new constraints are added in step 104 . If the checks are passed in step 108 , the method moves to a step 112 in which code is generated from the model and the constraints. In a step 114 , the generated code is tested.
- test code step 114 The knowledge of a test expert is used for the test code step 114 .
- the step 114 checks that the constraint specification for the model is valid. If the test is not passed, in a step 116 the method moves back to step 110 in which the constraints are refined. If the test in step 114 is passed, the method moves from step 116 to a step 118 in which the code is deployed.
- the development process 100 shown in FIG. 1 uses the expertise of a constraint expert and a test expert in addition to the knowledge of the model developer.
- the present invention is directed to a method, data processing system, and computer program product as defined in the independent claims. Further embodiments of the invention are described in the dependent claims.
- a method of generating code from a class model for a modeled system specifies a plurality of elements of a modeling language and dependencies between the elements.
- the method comprises analyzing the class model to identify a first possible source of under-specification with respect to the modeled system. Pattern recognition is used to find an occurrence of a first problem pattern of a plurality of problem patterns in the class model.
- the plurality of problem patterns is stored in a repository.
- the method further comprises identifying a set of constraint patterns comprising at least a first constraint pattern.
- the at least first constraint pattern is linked in the repository to the first problem pattern.
- the first constraint pattern is a resolution to the first possible source of under-specification in the class model.
- the method further comprises presenting, e.g. by means of displaying, the set of constraint patterns to a user.
- the method further comprises receiving a user selection from the user.
- the user selection comprises a constraint pattern from the set of constraint patterns.
- the method further comprises instantiating constraints from the user selection.
- the method further comprises generating code based on the class model and the instantiated constraints.
- Embodiments of the invention are advantageous as potential constraints for the class model are automatically identified and presented to a user. Thus, the expertise of a constraints expert is not required for the generation of constraints.
- the step of identifying a set of constraint patterns further comprises determining conflicts between constraints in the class model and constraint patterns in the set of constraint patterns.
- Embodiments of the present invention are particularly advantageous as potential conflicts between constraints are identified before the constraints are instantiated. This means that potential conflicts between constraints are identified without the need for the step of testing the code which is shown as step 114 in FIG. 1 .
- embodiments of the present invention allow a development process without the need for a cycle such as that shown in FIG. 1 where the step 110 may need to be repeated a number of times. Embodiments of the invention therefore provide an efficient development process as the load upon processing resources is minimized.
- the set of constraint patterns are selected from a constraint pattern repository storing parameterizable constraint patterns.
- the parameterizable constraint patterns are stored with information about potential conflicts and redundancies with other constraint patterns.
- the parameterizable constraint patterns are parameterizable by moving, e.g. by dragging and dropping, elements of the plurality of elements into parameter slots of the parameterizable constraint patterns.
- Embodiments of the present invention therefore provide user-friendly constraint pattern instantiation.
- the step of presenting the set of constraint patterns to a user further comprises presenting a context, a description, and potential resolution alternatives as a table to the user.
- the context is an identifier of the element in the plurality of elements associated with the first possible source of under-specification
- the description describes the first possible source of under-specification
- the potential resolution alternatives are identifiers of the at least first constraint pattern.
- a computer program product comprises computer-executable instructions.
- the instructions are adapted, when executed on a computer, to cause the computer to perform the steps of the method in accordance with the invention.
- a data processing system for generating code from a class model for a modeled system.
- FIG. 1 shows a flow diagram illustrating a constraint development process.
- FIG. 2 shows a block diagram of a data processing system.
- FIG. 3 shows schematically a class model
- FIG. 4 shows schematically a class model of a company.
- FIG. 5 shows a flow diagram illustrating steps performed in a method of generating code from a class model.
- FIG. 2 shows a block diagram of a data-processing system 200 .
- the data-processing system 200 comprises a microprocessor 202 , storage 204 , a display 206 as output device, and an input device 208 .
- Microprocessor 202 executes an operating system 210 .
- the operating system 210 is used to execute a computer program product 212 .
- the codes of the operating system 210 and of the computer program product 212 are stored on the storage 204 , and loaded for execution onto the microprocessor 202 .
- Computer program product 212 works as a code generator tool for generating code from a class model.
- An example of a class model is shown in FIG. 3 .
- Storage 204 stores a class model 214 and a repository 220 .
- Class model 214 specifies a number of elements 216 , 216 ′, and the relationships 218 between the elements.
- the repository 220 stores problem patters 222 and comprises links between these problem patterns and constraint patterns 224 .
- Display 206 displays a graphical user interface 226 .
- a user may manipulate the graphical user interface 226 using input device 208 .
- Input device 208 may comprise a keyboard, a mouse, or other input device.
- FIG. 3 shows an example of a class model 300 .
- Class model 300 contains classes 302 , 304 , 308 , 314 and 316 .
- Class 302 has attributes attribute 1 a and attribute 1 b.
- Class 304 has attribute attribute 2 .
- the relationship between the objects represented by class 302 and 304 is represented by association 306 , which comprises properties 305 and 307 .
- the multiplicities of the property 305 are shown by the symbol * which indicates that the multiplicity is unbound, and the multiplicities of the property 307 are shown by the interval 0 . . . 1 which indicates that the multiplicity can take either the value 0 or 1.
- Class 308 and class 302 have a super-class relationship 310 which indicates that class 308 is derived from class 302 .
- Class 308 and class 302 have association 312 .
- Classes 314 and 316 are derived from class 304 . This is indicated by relationships 318 and 319 .
- the classes shown in FIG. 3 may represent elements of a modeled system. The associations 306 and 312 would therefore represent relationships or dependencies between these elements.
- FIG. 4 shows an example of a class model of a company 400 .
- the classes of company 400 are employee 402 , office 404 , manager 408 , single 414 , and cubicle 416 .
- the class manager 408 is derived from the class employee 402 . This is illustrated by dependency 410 .
- the class single 414 and the class cubicle 416 are derived from the class office 404 . This is indicated by dependencies 418 and 419 .
- the relationship between the class employee 402 and the class office 404 is indicated by association 406 .
- Office 404 has inhabitants which are employees from the class employee 402 . The multiplicity of this relationship is unbound, meaning that the number of employees in an office is not limited.
- Employee 402 has a working relationship with office 404 .
- the multiplicity of this relationship can either be 0 or 1, meaning that each employee can only work in either 0 offices or 1 office.
- the relationship between employee and manager is indicated by association 412 .
- a manager 408 employs an employee 402 .
- the multiplicity of this relationship is unbound.
- An employee 402 works for a manager 408 .
- the multiplicity of this relationship ranges from 1 to unbound, meaning that an employee must have at least one manager but can have an unlimited number of managers.
- class models 300 in FIG. 3 and 400 in FIG. 4 show the elements and relationships and dependencies between elements that can be graphically displayed and specified in a modeling language.
- Modeled systems such as the company modeled by class model 400 may have constraints that cannot be specified graphically.
- a class model is called “under-specified” with respect to the system which it models if instances of the class model can be created which are not instances of the system modeled.
- To use an example in the company of the system according to class model 400 the number of inhabitants of an office may be limited by the number of desks in an office.
- the multiplicity of the relationship 406 may not in fact be unbound but dependent upon an attribute of office 404 .
- a constraint upon the multiplicity of the relationship 406 would be to make the multiplicity dependent upon the number of desks in office 404 .
- Potential sources of under-specification in a class model comprise:
- multiplicities of associations is the restriction on inhabitants of an office to the number of desks in that office.
- An example of a specification using property types is that only managers can occupy single offices, and managers cannot occupy cubicles.
- An example of a reflexive association is that a manager employs an employee, but a manager is an instance of an employee, therefore each manager must themselves have a manager. This creates two problems, one of cycles and the second that arbitrary path lengths may exist.
- a further problem of under-specification is that unique object identifiers may not exist. For example there may be more than one employee with a particular name.
- a further potential source of under-specification is that in a system there may be relations between properties. For example in the company modeled by class model 400 , the number of employees that a manager can employ may be limited such that the total salary of the employees must be less than the budget of the manager.
- the sources of under-specification detailed above may be removed by constraining the class model, for example by adding a constraint on the multiplicity of an association based on an attribute. Constraints may be added on the sub-classes of a super-class which can be associated with sub-classes of another super-class. Arbitrary path lengths and cyclic dependencies between objects caused by reflexive associations can be avoided by adding a constraint on the reflexive association.
- Unique object identifiers can be created by for example including more than one attribute in an object identifier. Complex relations between attribute values can also be expressed by constraints.
- Computer program product 212 of data processing system 200 is operable to analyze class model 214 by means of a class model analyzer 230 and to select problem patterns which are indicative of under-specification as discussed above, by means of a pattern selector 231 .
- Problem patterns 222 are identified from repository 220 .
- the problem patterns 222 are linked to constraint patterns 224 .
- a constraint pattern or a number of constraint patterns 224 which are linked to the problem pattern 222 are suggested to the user and displayed via graphical user interface 226 .
- the user can then use input device 208 to select the constraint for inclusion in the class model.
- Class model analyzer 230 and pattern selector 231 can be realized as modules of the computer program product 212 .
- FIG. 5 shows a method 500 for generating code from a class model of a modeled system.
- the model is analyzed.
- the analysis in step 502 comprises identifying problem patterns in the class model, thereby identifying a first possible source of under-specification with respect to the modeled system in the class model 214 . This is done by comparing problem patterns 222 stored in a repository 220 with the class model 214 , i.e. using pattern recognition to find an occurrence of the first problem pattern of the plurality of problem patterns 222 in the class model 214 .
- a set of constraint patterns is identified. The constraint patterns are linked to the problem patterns 222 in the repository 220 .
- a set of constraint patterns is identified comprising at least a first constraint pattern 224 , which at least first constraint pattern 224 is linked in the repository 220 to the first problem pattern, wherein the at least first constraint pattern 224 is a resolution to the first possible source of under-specification in the class model 214 .
- a presentation step 506 the set of constraint patterns are presented, i.e. displayed to the user.
- a reception step 508 a user selection of one or more constraint patterns from the set of constraint patterns displayed to the user is received.
- an instantiation step 510 one or more constraints are instantiated from the constraint patterns in the user selection, by means of an instantiator 232 .
- code is generated based on the class model 214 and the one or more instantiated constraints. The code is generated in a code generation step 512 using a code generator 233 .
- This code generator 233 can be embodied using methods and tools known in the art.
- Instantiator 232 and code generator 233 can be realized as modules of the computer program product 212 .
- the presentation step 506 and the reception step 508 can be omitted if the set of constraint patterns comprises only one constraint pattern 224 . In this event, there would be the possibility for the system to assume that the user will want to execute the constrain pattern, and the constraint pattern 224 can be automatically selected for the instantiation step.
- the user may be shown a preview of possible constraint patterns.
- the user can select a constraint pattern to be instantiated and added to the model by for example double clicking using a mouse on an instance of a constraint pattern.
- constraints between current constraints in the class model and the constraint pattern instances to be added may also be identified in the selection step 504 and be presented in the presentation step 506 to the user.
- the computer program product 212 in FIG. 2 may contain instructions such that conflicting constraint patterns cannot be instantiated unless the reason for the conflict is eliminated by the user.
- the preview of possible constraint patterns may be presented to the user as a table.
- the table may comprise a context comprising an identifier of the element of the class model associated with the first possible source of under-specification, a description describing the first possible source of under-specification and potential resolution alternatives comprising identifiers of the at least first constraint pattern. The same is possible for the other sources of under-specification.
- the repository 220 shown in FIG. 2 may comprise a constraint pattern library. This may be implemented in a tool such as IBM Rational Software Architect (RSA). The user may be able to choose one or more constraint patterns from the constraint pattern library and create instances of them by moving, e.g. dragging and dropping the constraint patterns into the model.
- the constraint patterns stored in the constraint pattern library may be parameterizable by moving model elements into parameter slots.
- the parameterizable constraint patterns can be stored with information about potential conflicts and redundancies with other constraint patterns.
- the invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements.
- the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
- the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system.
- a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
- the medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium.
- Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk.
- Examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
- a data-processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus.
- the memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code is retrieved from bulk storage during execution.
- I/O devices including but not limited to keyboards, displays, pointing devices, etc.
- I/O controllers can be coupled to the system either directly or through intervening I/O controllers.
- Network adapters may also be coupled to the system to enable the data-processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks.
- Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
- The present application claims the benefit under 35 U.S.C. §119 of Switzerland; Application Serial Number 07116302.6, filed Sep. 13, 2007 entitled “Generating Constrains in a Class Model,” which is incorporated herein by reference.
- The invention relates to a method, computer program product and data processing system for generating code from a class model.
- Modeling languages such as the unified modeling language provide a variety of model types for describing properties of a modeled system. A class model models the underlying data model of a system in an object oriented manner. A class model specifies elements of modeling languages and dependencies between the elements. Class models have diagrammatic syntax and therefore allow people without skills in computer science to model data.
- The limited expressiveness of diagrammatic models often means that class models produced by graphical specification are often under-specified with respect to the system modeled. The term under-specified is used here to indicate that instances of the model can exist which do not conform to objects in the modeled system. Textual constraints are therefore used to express details that are either difficult or impossible to express diagrammatically. Thus in the development of code from a class model, constraints are helpful to make the model consistent with the modeled system.
-
FIG. 1 shows a flow diagram illustrating the steps involved in the state of theart development process 100. In astep 102, a model is created. This can be performed graphically by a model developer. In astep 104 constraints are added to the model. Thestep 104 is carried out by a constraints expert. In astep 106, the constraints are checked for correct syntax and types. If the checks are not passed in astep 108, the constraints are refined in astep 110 and potentially new constraints are added instep 104. If the checks are passed instep 108, the method moves to astep 112 in which code is generated from the model and the constraints. In astep 114, the generated code is tested. The knowledge of a test expert is used for thetest code step 114. Thestep 114 checks that the constraint specification for the model is valid. If the test is not passed, in astep 116 the method moves back tostep 110 in which the constraints are refined. If the test instep 114 is passed, the method moves fromstep 116 to astep 118 in which the code is deployed. - The
development process 100 shown inFIG. 1 uses the expertise of a constraint expert and a test expert in addition to the knowledge of the model developer. - The present invention is directed to a method, data processing system, and computer program product as defined in the independent claims. Further embodiments of the invention are described in the dependent claims.
- According to an embodiment of the present invention, there is provided a method of generating code from a class model for a modeled system. The class model specifies a plurality of elements of a modeling language and dependencies between the elements. The method comprises analyzing the class model to identify a first possible source of under-specification with respect to the modeled system. Pattern recognition is used to find an occurrence of a first problem pattern of a plurality of problem patterns in the class model. The plurality of problem patterns is stored in a repository. The method further comprises identifying a set of constraint patterns comprising at least a first constraint pattern. The at least first constraint pattern is linked in the repository to the first problem pattern. The first constraint pattern is a resolution to the first possible source of under-specification in the class model. The method further comprises presenting, e.g. by means of displaying, the set of constraint patterns to a user. The method further comprises receiving a user selection from the user. The user selection comprises a constraint pattern from the set of constraint patterns. The method further comprises instantiating constraints from the user selection. The method further comprises generating code based on the class model and the instantiated constraints.
- Embodiments of the invention are advantageous as potential constraints for the class model are automatically identified and presented to a user. Thus, the expertise of a constraints expert is not required for the generation of constraints.
- According to an embodiment of the present invention, the step of identifying a set of constraint patterns further comprises determining conflicts between constraints in the class model and constraint patterns in the set of constraint patterns. Embodiments of the present invention are particularly advantageous as potential conflicts between constraints are identified before the constraints are instantiated. This means that potential conflicts between constraints are identified without the need for the step of testing the code which is shown as
step 114 inFIG. 1 . Thus, embodiments of the present invention allow a development process without the need for a cycle such as that shown inFIG. 1 where thestep 110 may need to be repeated a number of times. Embodiments of the invention therefore provide an efficient development process as the load upon processing resources is minimized. - According to a preferred embodiment of the present invention, the set of constraint patterns are selected from a constraint pattern repository storing parameterizable constraint patterns.
- According to a preferred embodiment of the present invention, the parameterizable constraint patterns are stored with information about potential conflicts and redundancies with other constraint patterns.
- According to a preferred embodiment of the present invention, the parameterizable constraint patterns are parameterizable by moving, e.g. by dragging and dropping, elements of the plurality of elements into parameter slots of the parameterizable constraint patterns. Embodiments of the present invention therefore provide user-friendly constraint pattern instantiation.
- According to a preferred embodiment of the present invention, the step of presenting the set of constraint patterns to a user further comprises presenting a context, a description, and potential resolution alternatives as a table to the user. The context is an identifier of the element in the plurality of elements associated with the first possible source of under-specification, the description describes the first possible source of under-specification, and the potential resolution alternatives are identifiers of the at least first constraint pattern.
- According to a preferred embodiment of the present invention, there is provided a computer program product. The computer program product comprises computer-executable instructions. The instructions are adapted, when executed on a computer, to cause the computer to perform the steps of the method in accordance with the invention.
- According to a preferred embodiment of the present invention, there is provided a data processing system for generating code from a class model for a modeled system.
- In the following, embodiments of the invention will be described in greater detail by way of example only making reference to the drawings in which:
-
FIG. 1 shows a flow diagram illustrating a constraint development process. -
FIG. 2 shows a block diagram of a data processing system. -
FIG. 3 shows schematically a class model. -
FIG. 4 shows schematically a class model of a company. -
FIG. 5 shows a flow diagram illustrating steps performed in a method of generating code from a class model. -
FIG. 2 shows a block diagram of a data-processing system 200. The data-processing system 200 comprises amicroprocessor 202,storage 204, adisplay 206 as output device, and aninput device 208.Microprocessor 202 executes anoperating system 210. Theoperating system 210 is used to execute acomputer program product 212. The codes of theoperating system 210 and of thecomputer program product 212 are stored on thestorage 204, and loaded for execution onto themicroprocessor 202. -
Computer program product 212 works as a code generator tool for generating code from a class model. An example of a class model is shown inFIG. 3 . -
Storage 204 stores aclass model 214 and arepository 220.Class model 214 specifies a number ofelements relationships 218 between the elements. Therepository 220 stores problem patters 222 and comprises links between these problem patterns and constraint patterns 224. -
Display 206 displays agraphical user interface 226. A user may manipulate thegraphical user interface 226 usinginput device 208.Input device 208 may comprise a keyboard, a mouse, or other input device. -
FIG. 3 shows an example of aclass model 300.Class model 300 containsclasses Class 302 has attributes attribute1 a and attribute1 b.Class 304 has attribute attribute2. The relationship between the objects represented byclass association 306, which comprisesproperties property 305 are shown by the symbol * which indicates that the multiplicity is unbound, and the multiplicities of theproperty 307 are shown by the interval 0 . . . 1 which indicates that the multiplicity can take either thevalue 0 or 1.Class 308 andclass 302 have asuper-class relationship 310 which indicates thatclass 308 is derived fromclass 302.Class 308 andclass 302 haveassociation 312.Classes class 304. This is indicated byrelationships FIG. 3 may represent elements of a modeled system. Theassociations -
FIG. 4 shows an example of a class model of acompany 400. The classes ofcompany 400 areemployee 402,office 404,manager 408, single 414, andcubicle 416. Theclass manager 408 is derived from theclass employee 402. This is illustrated bydependency 410. Similarly the class single 414 and theclass cubicle 416 are derived from theclass office 404. This is indicated bydependencies class employee 402 and theclass office 404 is indicated byassociation 406.Office 404 has inhabitants which are employees from theclass employee 402. The multiplicity of this relationship is unbound, meaning that the number of employees in an office is not limited.Employee 402 has a working relationship withoffice 404. The multiplicity of this relationship can either be 0 or 1, meaning that each employee can only work in either 0 offices or 1 office. The relationship between employee and manager is indicated byassociation 412. Amanager 408 employs anemployee 402. The multiplicity of this relationship is unbound. Anemployee 402 works for amanager 408. The multiplicity of this relationship ranges from 1 to unbound, meaning that an employee must have at least one manager but can have an unlimited number of managers. - The examples of
class models 300 inFIG. 3 and 400 inFIG. 4 show the elements and relationships and dependencies between elements that can be graphically displayed and specified in a modeling language. Modeled systems such as the company modeled byclass model 400 may have constraints that cannot be specified graphically. A class model is called “under-specified” with respect to the system which it models if instances of the class model can be created which are not instances of the system modeled. To use an example in the company of the system according toclass model 400 the number of inhabitants of an office may be limited by the number of desks in an office. Thus the multiplicity of therelationship 406 may not in fact be unbound but dependent upon an attribute ofoffice 404. Thus a constraint upon the multiplicity of therelationship 406 would be to make the multiplicity dependent upon the number of desks inoffice 404. - Potential sources of under-specification in a class model comprise:
-
- The multiplicity of an association
- A restriction on property types
- The existence of reflexive associations
- A lack of unique object identifiers
- Relations between class attributes
- An example of multiplicities of associations is the restriction on inhabitants of an office to the number of desks in that office. An example of a specification using property types is that only managers can occupy single offices, and managers cannot occupy cubicles. An example of a reflexive association is that a manager employs an employee, but a manager is an instance of an employee, therefore each manager must themselves have a manager. This creates two problems, one of cycles and the second that arbitrary path lengths may exist.
- A further problem of under-specification is that unique object identifiers may not exist. For example there may be more than one employee with a particular name. A further potential source of under-specification is that in a system there may be relations between properties. For example in the company modeled by
class model 400, the number of employees that a manager can employ may be limited such that the total salary of the employees must be less than the budget of the manager. - The sources of under-specification detailed above may be removed by constraining the class model, for example by adding a constraint on the multiplicity of an association based on an attribute. Constraints may be added on the sub-classes of a super-class which can be associated with sub-classes of another super-class. Arbitrary path lengths and cyclic dependencies between objects caused by reflexive associations can be avoided by adding a constraint on the reflexive association. Unique object identifiers can be created by for example including more than one attribute in an object identifier. Complex relations between attribute values can also be expressed by constraints.
-
Computer program product 212 ofdata processing system 200 is operable to analyzeclass model 214 by means of aclass model analyzer 230 and to select problem patterns which are indicative of under-specification as discussed above, by means of apattern selector 231. Problem patterns 222 are identified fromrepository 220. The problem patterns 222 are linked to constraint patterns 224. For each identified problem pattern 222, a constraint pattern or a number of constraint patterns 224 which are linked to the problem pattern 222 are suggested to the user and displayed viagraphical user interface 226. The user can then useinput device 208 to select the constraint for inclusion in the class model.Class model analyzer 230 andpattern selector 231 can be realized as modules of thecomputer program product 212. -
FIG. 5 shows amethod 500 for generating code from a class model of a modeled system. In ananalysis step 502, the model is analyzed. The analysis instep 502 comprises identifying problem patterns in the class model, thereby identifying a first possible source of under-specification with respect to the modeled system in theclass model 214. This is done by comparing problem patterns 222 stored in arepository 220 with theclass model 214, i.e. using pattern recognition to find an occurrence of the first problem pattern of the plurality of problem patterns 222 in theclass model 214. In aselection step 504, a set of constraint patterns is identified. The constraint patterns are linked to the problem patterns 222 in therepository 220. More precisely a set of constraint patterns is identified comprising at least a first constraint pattern 224, which at least first constraint pattern 224 is linked in therepository 220 to the first problem pattern, wherein the at least first constraint pattern 224 is a resolution to the first possible source of under-specification in theclass model 214. - In a
presentation step 506, the set of constraint patterns are presented, i.e. displayed to the user. In areception step 508, a user selection of one or more constraint patterns from the set of constraint patterns displayed to the user is received. In aninstantiation step 510, one or more constraints are instantiated from the constraint patterns in the user selection, by means of aninstantiator 232. In astep 512, code is generated based on theclass model 214 and the one or more instantiated constraints. The code is generated in acode generation step 512 using acode generator 233. Thiscode generator 233 can be embodied using methods and tools known in the art.Instantiator 232 andcode generator 233 can be realized as modules of thecomputer program product 212. - The
presentation step 506 and thereception step 508 can be omitted if the set of constraint patterns comprises only one constraint pattern 224. In this event, there would be the possibility for the system to assume that the user will want to execute the constrain pattern, and the constraint pattern 224 can be automatically selected for the instantiation step. - When there is more than one possible resolution for a problem pattern, the user may be shown a preview of possible constraint patterns. The user can select a constraint pattern to be instantiated and added to the model by for example double clicking using a mouse on an instance of a constraint pattern. When constraint patterns are presented to the user, conflicts between current constraints in the class model and the constraint pattern instances to be added may also be identified in the
selection step 504 and be presented in thepresentation step 506 to the user. Thecomputer program product 212 inFIG. 2 may contain instructions such that conflicting constraint patterns cannot be instantiated unless the reason for the conflict is eliminated by the user. - The preview of possible constraint patterns may be presented to the user as a table. The table may comprise a context comprising an identifier of the element of the class model associated with the first possible source of under-specification, a description describing the first possible source of under-specification and potential resolution alternatives comprising identifiers of the at least first constraint pattern. The same is possible for the other sources of under-specification.
- The
repository 220 shown inFIG. 2 may comprise a constraint pattern library. This may be implemented in a tool such as IBM Rational Software Architect (RSA). The user may be able to choose one or more constraint patterns from the constraint pattern library and create instances of them by moving, e.g. dragging and dropping the constraint patterns into the model. The constraint patterns stored in the constraint pattern library may be parameterizable by moving model elements into parameter slots. The parameterizable constraint patterns can be stored with information about potential conflicts and redundancies with other constraint patterns. - The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
- Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
- The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
- A data-processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code is retrieved from bulk storage during execution.
- Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
- Network adapters may also be coupled to the system to enable the data-processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US13/456,745 US8918756B2 (en) | 2007-09-13 | 2012-04-26 | Generating constraints in a class model |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP07116302 | 2007-09-13 | ||
CH07116302.6 | 2007-09-13 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/456,745 Continuation US8918756B2 (en) | 2007-09-13 | 2012-04-26 | Generating constraints in a class model |
Publications (1)
Publication Number | Publication Date |
---|---|
US20090077511A1 true US20090077511A1 (en) | 2009-03-19 |
Family
ID=40455920
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US12/201,828 Abandoned US20090077511A1 (en) | 2007-09-13 | 2008-08-29 | Generating Constraints in a Class Model |
US13/456,745 Expired - Fee Related US8918756B2 (en) | 2007-09-13 | 2012-04-26 | Generating constraints in a class model |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/456,745 Expired - Fee Related US8918756B2 (en) | 2007-09-13 | 2012-04-26 | Generating constraints in a class model |
Country Status (1)
Country | Link |
---|---|
US (2) | US20090077511A1 (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011149553A1 (en) * | 2010-05-27 | 2011-12-01 | The Mathworks, Inc. | Partitioning block diagrams into executable contextual models |
US20130290923A1 (en) * | 2012-04-30 | 2013-10-31 | General Electric Company | Systems and Methods for Generating a Standardized Power Generation Class Model |
US20140172895A1 (en) * | 2012-12-18 | 2014-06-19 | Michael Hartel | Modeled Associations for Business Object Data Structures |
EP2838016A1 (en) * | 2013-08-15 | 2015-02-18 | Palo Alto Research Center Incorporated | Automated augmented model extension for robust system design |
US10318653B1 (en) | 2015-02-26 | 2019-06-11 | The Mathworks, Inc. | Systems and methods for creating harness models for model verification |
US10521197B1 (en) | 2016-12-02 | 2019-12-31 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US10657208B2 (en) | 2010-05-27 | 2020-05-19 | The Mathworks, Inc. | Analyzing model based on design interest |
US10719645B1 (en) | 2010-05-27 | 2020-07-21 | The Mathworks, Inc. | Model structure analysis with integration of transformed slice |
US11829689B1 (en) * | 2020-06-09 | 2023-11-28 | The Mathworks, Inc. | Systems and methods for creating variant regions in acausal simulation models |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050010922A1 (en) * | 2003-06-30 | 2005-01-13 | Greg Czajkowski | Solutions for constraint satisfaction problems requiring multiple constraints |
US20050027542A1 (en) * | 2003-07-28 | 2005-02-03 | International Business Machines Corporation | Method and system for detection of integrity constraint violations |
US20080208648A1 (en) * | 2007-02-23 | 2008-08-28 | Accenture Global Services Gmbh | Constraints-based analysis and strategy planning methods and tools |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2134059C (en) * | 1993-10-29 | 2009-01-13 | Charles Simonyi | Method and system for generating a computer program |
US7478419B2 (en) * | 2005-03-09 | 2009-01-13 | Sun Microsystems, Inc. | Automated policy constraint matching for computing resources |
US7681187B2 (en) * | 2005-03-31 | 2010-03-16 | Nvidia Corporation | Method and apparatus for register allocation in presence of hardware constraints |
US8700378B1 (en) * | 2007-12-12 | 2014-04-15 | The Mathworks, Inc. | Symbolic expression propagation to support generating reconfiguration code |
-
2008
- 2008-08-29 US US12/201,828 patent/US20090077511A1/en not_active Abandoned
-
2012
- 2012-04-26 US US13/456,745 patent/US8918756B2/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050010922A1 (en) * | 2003-06-30 | 2005-01-13 | Greg Czajkowski | Solutions for constraint satisfaction problems requiring multiple constraints |
US20050027542A1 (en) * | 2003-07-28 | 2005-02-03 | International Business Machines Corporation | Method and system for detection of integrity constraint violations |
US20080208648A1 (en) * | 2007-02-23 | 2008-08-28 | Accenture Global Services Gmbh | Constraints-based analysis and strategy planning methods and tools |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10691578B2 (en) | 2010-05-27 | 2020-06-23 | The Mathworks, Inc. | Deriving contextual information for an execution constrained model |
US10657208B2 (en) | 2010-05-27 | 2020-05-19 | The Mathworks, Inc. | Analyzing model based on design interest |
US10657029B2 (en) | 2010-05-27 | 2020-05-19 | The Mathworks, Inc. | Partitioning block diagrams into executable contextual models |
WO2011149553A1 (en) * | 2010-05-27 | 2011-12-01 | The Mathworks, Inc. | Partitioning block diagrams into executable contextual models |
US8812276B2 (en) | 2010-05-27 | 2014-08-19 | The Mathworks, Inc. | Determining model components suitable for verification analysis |
US10719645B1 (en) | 2010-05-27 | 2020-07-21 | The Mathworks, Inc. | Model structure analysis with integration of transformed slice |
US9164739B2 (en) * | 2012-04-30 | 2015-10-20 | General Electric Company | Systems and methods for generating a standardized power generation class model |
EP2660718A3 (en) * | 2012-04-30 | 2014-04-02 | General Electric Company | Systems and methods for generating a standardized power generation class model |
US20130290923A1 (en) * | 2012-04-30 | 2013-10-31 | General Electric Company | Systems and Methods for Generating a Standardized Power Generation Class Model |
US9262549B2 (en) * | 2012-12-18 | 2016-02-16 | Sap Se | Modeled associations for business object data structures |
US20140172895A1 (en) * | 2012-12-18 | 2014-06-19 | Michael Hartel | Modeled Associations for Business Object Data Structures |
EP2838016A1 (en) * | 2013-08-15 | 2015-02-18 | Palo Alto Research Center Incorporated | Automated augmented model extension for robust system design |
US10318653B1 (en) | 2015-02-26 | 2019-06-11 | The Mathworks, Inc. | Systems and methods for creating harness models for model verification |
US10545731B1 (en) | 2016-12-02 | 2020-01-28 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US10521197B1 (en) | 2016-12-02 | 2019-12-31 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US10866789B1 (en) | 2016-12-02 | 2020-12-15 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US11126407B1 (en) | 2016-12-02 | 2021-09-21 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US11360747B1 (en) | 2016-12-02 | 2022-06-14 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US11409504B1 (en) | 2016-12-02 | 2022-08-09 | The Mathworks, Inc. | Variant modeling elements in graphical programs |
US11829689B1 (en) * | 2020-06-09 | 2023-11-28 | The Mathworks, Inc. | Systems and methods for creating variant regions in acausal simulation models |
Also Published As
Publication number | Publication date |
---|---|
US8918756B2 (en) | 2014-12-23 |
US20120272211A1 (en) | 2012-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8918756B2 (en) | Generating constraints in a class model | |
US9946517B2 (en) | Dynamic model based software application development | |
US7844942B2 (en) | System and method for model driven transformation filtering | |
Kazman et al. | Architecture reconstruction guidelines | |
Kazman | Assessing architectural complexity | |
JPH06103046A (en) | System design method | |
JP2007012088A (en) | Incremental build system | |
US20060020931A1 (en) | Method and apparatus for managing complex processes | |
Koni-N’Sapu | A scenario based approach for refactoring duplicated code in object oriented systems | |
US9170783B1 (en) | Class creation assistant for textual programming languages | |
JP2013152730A (en) | Plasma processing system component analysis software and method and system for creating the same | |
KR20090099977A (en) | A reserved component container based software development method and apparatus | |
Molina | Reverse engineering of event handlers of rad-based applications | |
JP4948126B2 (en) | Program for analyzing large-scale business system using Java (registered trademark) language program and processing method thereof | |
US11442845B2 (en) | Systems and methods for automatic test generation | |
Delmas et al. | A verification and validation process for model-driven engineering | |
Lyons et al. | Lightweight multilingual software analysis | |
Pepin et al. | Virtual Extension of Meta-models with Facet Tools. | |
Mrasek et al. | Property specification, process verification, and reporting–A case study with vehicle-commissioning processes | |
Dolques et al. | Fixing Generalization Defects in UML Use Case Diagrams. | |
Zhang et al. | Java source code static check eclipse plug-in based on common design pattern | |
Salah | An environment for comprehending the behavior of software systems | |
Tao | Toward Computer-Aided Usability Evaluation Evolving Interactive Software. | |
Schaad | Boosting Performance Engineering with Visual Interactive Optimization and Analysis | |
JPH10232769A (en) | Class addition supporting method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:WAHLER, MICHAEL S.;KOEHLER, JANA;REEL/FRAME:021464/0411;SIGNING DATES FROM 20080714 TO 20080716 |
|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO PAY ISSUE FEE |
|
AS | Assignment |
Owner name: GLOBALFOUNDRIES U.S. 2 LLC, NEW YORK Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTERNATIONAL BUSINESS MACHINES CORPORATION;REEL/FRAME:036550/0001 Effective date: 20150629 |
|
AS | Assignment |
Owner name: GLOBALFOUNDRIES INC., CAYMAN ISLANDS Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:GLOBALFOUNDRIES U.S. 2 LLC;GLOBALFOUNDRIES U.S. INC.;REEL/FRAME:036779/0001 Effective date: 20150910 |