31.01.2014 Views

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4. The GOPPRR Meta Meta Model – An Extension of GOPRR<br />

more invariants for a GOPPRR project, the context would be CProject. To select this context,<br />

the following OCL statement is used:<br />

context<br />

CProject<br />

An invariant construct within a certain context is prefixed by an inv: statement followed by<br />

the invariant expr<strong>es</strong>sion itself. This expr<strong>es</strong>sion follows in part the C++ syntax for acc<strong>es</strong>sing<br />

methods and attribut<strong>es</strong> of objects [79]. For clarification, the following OCL statement defin<strong>es</strong><br />

that all GOPPRR project objects must have a non empty ID:<br />

context CProject<br />

inv : m_ID ’ ’<br />

The following exampl<strong>es</strong> are used to clarify the usage of OCL for constraint definition, which<br />

are taken from the case study pr<strong>es</strong>ented in Part III.<br />

4.5.1. OCL Example: Global, Numerical Criteria<br />

The global occurrence of the graph type “EVCStateMachine” must be exact one:<br />

context CProject<br />

inv : m_GraphSet−>s e l e c t (m_Type = ’ EVCStateMachine ’ )−>s i z e ( ) = 1<br />

4.5.2. OCL Example: Numerical Criteria within a Graph<br />

All objects of the type “EVCState” within any graph of type “EVCStateMachine” must have at<br />

least one explosion:<br />

context CProject<br />

inv : m_GraphSet−>s e l e c t (m_Type = ’ EVCStateMachine ’ )−>f o r A l l ( m_ObjectSet−>s e l e c t (m_Type<br />

= ’ EVCState ’ )−>f o r A l l ( m_Explosions−>s i z e ( ) >= 1) )<br />

Combined with the prior constraint (Subsection 4.5.1), it can be reduced to:<br />

context CProject<br />

inv : m_GraphSet−>s e l e c t (m_Type = ’ EVCStateMachine ’ )−>s i z e ( ) = 1<br />

inv : m_GraphSet−>any (m_Type = ’ EVCStateMachine ’ ) . m_ObjectSet−>s e l e c t (m_Type =<br />

’ EVCState ’ )−>f o r A l l ( m_Explosions−>s i z e ( ) >= 1)<br />

An iteration (by the forAll() statement) over a set of multiple “EVCStateMachine” graphs<br />

is not required because the first invariant already requir<strong>es</strong> exact one instance of it. For<br />

simplification, this reduction is done for all following constraint exampl<strong>es</strong>.<br />

4.5.3. OCL Example: Boolean Criteria within a Graph by further Type<br />

Specification<br />

All “EVCGuard” properti<strong>es</strong> of all “EVCTransition” relationships within all “EVCStateMachine”<br />

graphs must also exist in at least one explosion of the corr<strong>es</strong>ponding objects connected by the<br />

“CurrentEVCState” role of the before selected relationship:<br />

48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!