Is there a way to check the validity of a model in a programmatic manner such as Validation > Validate Model does?
If you mean a model is valid, iff your self-defined well-formedness rules (WFR) are valid then you can use OCL. Define your constraints in OCL and use something like Dresden OCL to validate those WFRs.
You can use Dresden OCL either on its own integrated into your Eclipse with its views or you use the API of Dresden OCL in your program to verify the validity programmatically.
Speaking about the model validation, you must consider two aspects - model syntax and semantic.
Syntax validation is a trivial thing, partially available in some tools. UML has a precisely defined syntax and it can be easily checked automatically.
If the model represents the subject correctly is another problem and can be eventually validated via model execution. There are very few tools that provide very partial implementation of such execution.
In summary - model validation is comparable with source code validation - syntactic part is easy, while semantic is hard to prove.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With