

Among many other applications, OCL is frequently used to express model transformations (as part of the source and target patterns of transformation rules), well-formedness rules (as part of the definition of new domain-specific languages, or code generation templates (as a way to express the generation patterns and rules). Initially, OCL was only used as a constraint language for UML but quickly expanded its scope and now OCL has become a key component of any model-driven engineering (MDE) technique as the default language for expressing all kinds of (meta)model query, manipulation, and specification requirements. That standard came to be what we now know as UML and OCL became integrated in it in 1997. The work on OCL was part of a joint proposal with ObjectTime Limited presented as a response to the RFP for a standard object-oriented analysis and design language issued by the Object Management Group (OMG). OCL was first developed in 1995 inside IBM as an evolution of an expression language in the Syntropy method. The Object Constraint Language (OCL) appeared as an effort to overcome the limitations of UML when it comes to precisely specifying detailed aspects of a system design. Introduction to the Object Constraint Language tutorial
Bouml class diagram full#
The full text for this OCL tutorial can be found here but you can keep reading for a summary of the key sections, especially targeting OCL beginners (all the rest go to the previous link for the more complete discussion): 1. This OCL tutorial pretends to provide a comprehensive view of this language, its many applications, and available OCL tool support as well as the latest research developments and open challenges around it.Īnd these are the slides I used during the tutorial (these slides have been seen over 110.000 times! 👏👏👏) Among many other applications, OCL is frequently used to express model transformations (as part of the source and target patterns of transformation rules), well-formedness rules (as part of the definition of new domain-specific languages), or code-generation templates (as a way to express the generation patterns and rules). Since then, OCL has become a key component of any model-driven engineering (MDE) technique as the default language for expressing all kinds of (meta)model query, manipulation, and specification requirements. The Object Constraint Language (OCL) started as a complement of the UML notation with the goal to overcome the limitations of UML (and in general, any graphical notation) in terms of precisely specifying detailed aspects of a system design. School on Formal Methods: Model-Driven Engineering I´ve co-authored an OCL tutorial book chapter (together with Martin Gogolla) introducing the Object Constraint Language (you may want to read why you need to learn OCL first). But if you're learning, and for this specific example, it's also easily done manually (see for example this tutorial).As part of my participation in the 12th Int. Now there are tools like BoUML, and lots of other tools (just google for UML class diagram generate java code) that transform an UML diagram in Java. With composition, this would require to clone a College into the new University and destroy the original one (so after the operation, you'll have a new college), whereas with aggregation a simple reassignment would be sufficient. The reality is that occasionally a department moves from one college to the other, or that universities in the same town get merged, but the underlying colleges still remain unchanged except for their logo. But this semantic would not correspond to the academic reality. However composition would mean that a College would exist only as part of a specific University so when the University gets removed, so does the College.

Here, Colleges are a definitively parts of the whole University, and Departments are parts of a whole College.Ĭomposition is similar to aggregation, but with an exclusive ownership of the parts by the whole. more precise), because it expresses a whole-part relationship. Association can be correct, because aggregation or composition are special kind of associations.Īggregation would be better (i.e.
