Modeling with Instances

Navigation:  Instances >

Modeling with Instances

Previous pageReturn to chapter overviewNext page

 

1. Creating the Classifier elements

Assuming that you have decided to use Instances for some of your modeling, the challenge is how to use them effectively.

As an example, lets say you have modeled the idea of a Server and a Database Management System (DBMS) which it uses:

Notice how EA lets you add attributes to the elements, to show that instances of these elements can have values for each attribute.

When we are dealing elements from which we're going to create instances, we refer to those elements as the 'classifiers' of the instances - they tell the instance what kind of 'thing' it is.

2. Creating some instances

To create some instances, just click cntl-drag a classifier element into a diagram. Ea will ask you whether you want to drop the classifier, or an instance of it:

You can keep doing this until you have lots of instances:

These are all un-named instances of 'Production Web Server', but they don't have any attributes, not even a name.

You can name them in the usual EA way - open the Properties and add a name.

But what about all those attributes which each Production Web Server can have:

3. Adding data to instances

EA lets you add data to instances, using what it calls 'Run State Variables'.

In EA 14, right-click one of the instances in the EA Project Browser, and choose Features & Properties / Set Run State

You can now enter values for each attribute:

Your diagram will now be updated to show all these new values:

4. Challenges

This is OK if you one or two instances: but what if you have 100s or 1000s ? - see creating new instances with eaXL

And dragging and dropping each instance into a diagram is a really slow way of creating them. - see populating instance values with eaXL