2

I have been asked make and present an application design using UML. However, while doing my research, I have run into OCL. They seem to be almost the same. That is, they both do classes and their attributes and the relationship between the classes.

Which use cases are best best for UML and OCL respectively?

Thanks!

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Mamun
  • 2,322
  • 4
  • 27
  • 41

1 Answers1

5

No, they are two different things. OCL, the Object Contraint Language, is used to describe constraints in a formalized language with C-like syntax. OCL has the same parents like UML, namely OMG. You find a desciption of OCL at OMG's site. UML can use OCL to describe constraints. So OCL is an extension to UML.

OCL is (my point of view) more an academic thing. You get along with textual constraints in almost all cases. Reading OCL isn't that difficult. Though writing a constraints in correct syntax takes time to learn. Being able to apply correct OCL will help machines to generate code from UML. Only a few tools can do that (honestly, I never used any of them).

qwerty_so
  • 35,448
  • 8
  • 62
  • 86