-1

I have a class diagram which consist a class on the name of SYSTEM. I have written a constraint for availability of this system.

For example :

The system should be available 24/7.

Now I want to convert the above statement into OCL constraint. I am new to OCL. I have searched and tried some research papers and videos but nothing found specific for availability.

halfer
  • 19,824
  • 17
  • 99
  • 186
discky
  • 7
  • 3
  • Once you swallowed that document you should be fine writing your OCL. Basically this is your secret saouce: https://www.omg.org/spec/OCL/About-OCL/ – qwerty_so May 31 '18 at 22:21

1 Answers1

1

Ar run time: OCL evaluates and checks a query using the instantaneous system state.

OCL has no support for time, but you may Google for Temporal OCL to see what various researchers are doing. More generally time is an active research area without solid solutions. Unchanged, OCL can only access an up-time variable and check that it greater than 24 hours.... When you first start, is your system supposed to fail because it has not been available 24/7?

If you consider your specific query, it is obviously impossible. In practice designers may analyze the failure rates on one/two/three/...-fold redundant systems with respect to relevant foreseeable failure mechanisms. No system is likely to survive an unforeseen failure, let alone a hostile act by some insider, or a well-informed outsider. Again more realistically, there should be an SLA that accepts a certain amount of down time per year, the smaller the downtime the higher the cost.

At design time, you may use OCL as the formulation of your design constraints. e.g. the mathematics that computes the aggregate failure rate of a single server, or the composite failure rate of redundant servers. But OCL wouldn't be my first choice for complex floating point calculations.

Ed Willink
  • 1,205
  • 7
  • 8
  • is there any way to write constraints for user access levels like "only admin can generate authorization codes " ??? – discky Jun 01 '18 at 07:40
  • Good answer to the wrong question. The OP asks for a shotgun and gives one shot as example (see his additional grain above). – qwerty_so Jun 01 '18 at 08:00
  • I miss the critique. The answer considers relevant factors around time/reliability. Consider the OCL constraint that "the case color shall be lime green". This can only be implemented in OCL once there are controls that accurately determine the color, or sensors that enable the color to be measured and if the constraint is reformulated to have some perhaps RGB-space tolerances. OCL can only constrain what is made available to a computation. The questioner needs to reformulate after identifying plausible tolerances and input sensors. – Ed Willink Aug 17 '20 at 08:14