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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

usable for C++ class<strong>es</strong> and objects. The r<strong>es</strong>ulting structure of the GOPPRR C++ abstract<br />

syntax model is shown in Figure 4.4. Compared with the original abstract syntax, the following<br />

main extensions and modifications were done:<br />

• An additional class CCall 2 was added, which is used by CConnection as aggregation [64] to<br />

combine an object (CObject), a role (CRole), and an optional port (CPort). Without this<br />

addition, it could not be distinguished, which objects and ports belong to the same call.<br />

Caused by the circumstance that ports are optional, the size of direct associations [64] of<br />

ports in CConnection could be different and the assignment of ports to a concrete pair of<br />

object and role would be non-unique. CCall should be interpreted as the definition of<br />

one concrete end of a connection (CConnection) or rather binding (CBinding).<br />

• The class CGraphicalContainer was added to provide the information of graphical<br />

containment of objects and relationships. Instanc<strong>es</strong> are related to exact one graph object<br />

because the graphical containment feature is only valid in a certain graph but not for a<br />

whole project.<br />

• For all associations that ends at class<strong>es</strong> repr<strong>es</strong>enting GOPPRR base elements and have<br />

in their multiplicity [64] a not limited upper bound (stated by a *) a STL map [79] is<br />

used as container. The object identifier 3 (OID) is used as key [79] value in the map. The<br />

map ensur<strong>es</strong> that no duplicat<strong>es</strong> exist in association and elements can be easily acc<strong>es</strong>sed<br />

by their OID, but it also can be iterated, like a vector / stack or a list.<br />

While the C++ GOPPRR abstract syntax model provid<strong>es</strong> acc<strong>es</strong>s to all model information,<br />

it mak<strong>es</strong> the proc<strong>es</strong>sing of bindings in a certain graph quite more complex. Compared to<br />

the concrete syntax model used for MERL, bindings now cannot easily navigated by directly<br />

stating the type name, like<br />

. o b j e c t 1 ~role1 >r e l a t i o n s h i p ~ r o l e 2 . o b j e c t 2<br />

or<br />

. o b j e c t 1#port1~role1 >r e l a t i o n s h i p ~ r o l e 2#port2 . o b j e c t 2<br />

To reduce this drawback, the graph repr<strong>es</strong>entation class CGraph provid<strong>es</strong> several methods that<br />

abstracts the navigation via bindings. In the example below, the method returns all rol<strong>es</strong> of a<br />

certain type connected to a certain object. The returned map of rol<strong>es</strong> can be then proc<strong>es</strong>sed or<br />

used for further navigation to relationships or rol<strong>es</strong>.<br />

/∗ !<br />

∗ \ b r i e f a b s t r a c t i o n method<br />

∗<br />

∗ Gets c e r t a i n r o l e s connected to a c e r t a i n o b j e c t in a c e r t a i n graph .<br />

∗<br />

∗ \param [ in ] pObject : p o i n t e r to t h e o b j e c t<br />

∗ \param [ in ] Type : r o l e t y p e<br />

∗ \param [ in ] b SubString : i f true , Type only must be a s u b s t r i n g o f r o l e t y p e<br />

2 The name was chosen according to the connectionCall composition in the original structure.<br />

3 OIDs are not part of the original GOPRR meta meta model but are created in MetaEdit+ for each instance<br />

of a GOPRR element and are unique within a project.<br />

44

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

Saved successfully!

Ooh no, something went wrong!