Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Paolo F Cantoni

Pages: 1 ... 391 392 [393] 394
5881
Automation Interface, Add-Ins and Tools / Re: IsNew?
« on: August 15, 2005, 10:42:39 am »
Further investigation seems to suggest that IsNew is permanently set to True.

Paolo

5882
Automation Interface, Add-Ins and Tools / IsNew?
« on: August 14, 2005, 11:17:32 pm »
Exactly what does the EA.Element IsNew attribute mean?

The Help file says: Read/Write. Boolean value indicating element is new or not. 1 = true, 0 = false  
which is tautological. ::)

What are the semantics of IsNew?

Cheerz,
Paolo

5883
Well, I've done a bit of testing on my own.  I can't get either Element.Stereotype or Element.StereotypeEx to set the stereotype programmatically. ???

Has anybody done it?  (I'm using C#)

Help!

Paolo

5884
StereotypeEx is described in the Element automation help as: Read/Write. Returns all the applied stereotypes of the element in a comma-separated list .  Unfortunately, this is NOT true as it is always empty. ???  
To get the list of stereotypes you need: GetStereotypeList (), described (interestingly) as: Returns a comma-separated list of stereotypes allied to this element.

Has anybody used StereotypeEx to set the additional Stereotypes (I'm not yet doing so - since my current focus is on emitting the model, not modifying it).

The reason I'm asking is that although undocumented in the Help file,  Attributes and Methods also have StereotypeEx attributes.  Since you can't set these multiple attributes via the UI, I'm interested in setting and retrieving these via automation.

Perhaps a kind Sparxian will fill us in with the facts of the case?

Cheerz,
Paolo

Apparently, with this post, I'm deemed a GURU!  (500 posts...)  (It's amazing what a series of complaints and questions will get you...)
 


5885
Quote
[size=13][SNIP][/size]
Why use inner classes?  I mean, I use them but its always been a naturally "obvious" situation. Is there some design / architecture framework for recognizing that a class should be implemented as an inner?

bruce
I found this in my ramblings...

Recommendations on Nested Classes in Components

As an extension to those recommendations, I think the operative reason for instantiating a class as an inner (or nested) class relates to whether the instance of the inner class can be moved to another enclosure (parent).  This gets back, in part to the World vs Business vs System model.  In the real world, a tyre can be moved between wheels - in the Conceptual (World) model I would model it as such - composition.  But if in the system I was building, I wanted to see the tyre (to see if it was punctured or not) but not to move it, the transformation/generation policy would say "Instance cannot be re-enclosed" and so the generator would implement as a nested class.  If the policy was "Instance cannot be re-enclosed" the generator would implement as a non nested class.

HTH,
Paolo

5886
Quote
[size=13][SNIP][/size]
Why use inner classes?  I mean, I use them but its always been a naturally "obvious" situation. Is there some design / architecture framework for recognizing that a class should be implemented as an inner?

bruce
Since I'm primarily a modeller rather than a programmer, I'm not sure I've got good answers for that one.  However, let me throw the question back to you.  Think about the times you've used them for obvious reasons, is there a pattern (or a very small numbers of patterns) that can account for your usage?

Paolo

BTW: what's the formal definition of an Inner Class.  Are they necessarily singletons (in the meta sense).  That is, if you use exactly the same class structure inside two or more parents, do you (by definition) no longer have an inner class?

5887
When is an inner class not an inner class?
When it's connected to the parent class by a nesting relationship!

Create a class, create another class, link the first to the second via a nesting relationship.  Try to generate code for the "nested" (inner) class.  The UI will (correctly) tell you: "Generation of code for inner classes is only supported through generating the outer class"

Generate code for the outer calls, and the inner class is generated... So far so good.

The problem is that if you get a list of inner elements via the automation interface, this inner class is not listed.

Now, before I report this as a bug, can anyone confirm that (in their view) the nested class should be treated as a more normally created inner class.

Also, even for normal inner classes, they are exposed both as a class of their own and as an inner class.  As I'm emitting this information under my control, do people think I should repeat the class information or make the inner class a link to the other copy of the class.

(Recall that if we accept the nesting relationship, the linked class may be in an entirely different part of the model and may not be in the set of classes to be emitted)

Also, since it is possible to nest a class in more than one parent what does that do to things?

Cheerz,
Paolo

5888
Automation Interface, Add-Ins and Tools / Re: Feature linked Note - How
« on: August 15, 2005, 08:00:08 am »
Neil,

Just a further clarification if I may.  Although the UI requires you to act on the connector (link), the linkage is actually directly in  the element (note).  Correct?

Cheerz,
Paolo


5889
Automation Interface, Add-Ins and Tools / Re: Feature linked Note - How
« on: August 14, 2005, 04:48:45 pm »
Thanx Neil,

So, for Automation, I use get_MiscData(n-1) right?

Paolo

5890
Automation Interface, Add-Ins and Tools / Feature linked Note - How
« on: August 13, 2005, 09:47:45 pm »
I can get hold of the Note, and I can get hold of the Note Link with Automation, but I can't see how to get hold of the fact that the note may or may not be linked to an element feature.

Has anybody figured out how to do it?

Cheerz,
Paolo

5891
Quote
It's available (to read) in the MiscData(2) field.

Simon
Thanx, Simon.

I'll check it out when I get to work.  Does this mean I have to parse it like I would the PDATA3 field?

Paolo

5892
Hi,

In the automation interface, how can I get access to the Class parameters or arguments?  I can detect if they exist by using the Subtype, but I can't see how to get at them...

I'm talking about the properties available as ClassParameter and classArgument in the CTF.

Thanx,
Paolo

5893
Hi Polivka,

I've got some of my stuff refactored, I generate about 25KB of XML output in under 10 secs.  (only 5 classes, but a mixture of relations, attributes, operations, other stuff).

As I said before, about 5 secs is opening the model file. so that looks like about a class a sec.  What do others experience?

Paolo

5894
Hi Polivka,

I can't run any tests on my end, because my automation code is in the middle of refactoring (ie BROK) and I can't get to it at present.

My impression was it took about 5 secs to startup and then dumping a small package (15 elements) took less than 2 secs.

However, I'm running Jet 4.0 (SP8 ), if that's of use.   Oh, and I'm using C# to code...


HTH,
Paolo

5895
Quote
hi guys,
i am trying to walk through all model packages and elements using automation interface but it is terribly slow even for very small project. have you noticed it also?, or is it something wrong only in my case? i am using EA 5.00.768,win XP SP2,P4 2,4GHz, Mem 1GB.
thanks polivka
Hi Polivka,

What repository are you using?

I'm using an EAP (MS Access) repository and my impression is there is a fixed startup cost to open, load and resolve the model, thereafter traversal seems to be quite fast.

It's a bit like the file size.  It seems quite large for a few classes, but then it doesn't grow very much for a lot more stuff added.

HTH,
Paolo


Pages: 1 ... 391 392 [393] 394