Book a Demo

Author Topic: Question on the book "Scripting EA"  (Read 5318 times)

supplyondemand

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Question on the book "Scripting EA"
« on: July 12, 2012, 10:13:23 pm »
Hi Thomas,

I have two questions so far, I hope you can help me:

On page 9 I don't understand the sentence "The pointer is MiscData(0) which is the identifier of the element’s package counterpart." Could you explain a bit more?

Page 11: "Connectors always connect Elements". I just learned that I can also connect Attributes (of a class) using "Link to Element Feature", so is your statement really correct?

I wonder if it would make sense to have a dedicated thread where everyone who purchased your book can ask questions?

Best regards
Matthias

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Question on the book "Scripting EA"
« Reply #1 on: July 13, 2012, 12:39:44 am »
Hi Matthias,
there's a discussion forum on Leanpub's landing page for the book (for some reason nobody posts there). Also my mail address is present in the book (though I got few feedback through this channel too). And finally there's my initial post here where I announced the book. One of those channels should be okay.

But to answer your questions:

Page 9 - MiscData(0) contains the t_package.PackageID of the package for which this element is defined. When I started with this years ago I expected t_element.PackageID to be this pointer. But that actually points to the package of the package. A bit confusing. I will add a picture in the book to make it clearer. I hope you understand this explanation, though.

Page 11 - yes and no. Connectors actually connect elements. When connecting attribute this is done via some weird Style expression (can't tell this by heart now), But it's added somewhere inside the connector information. I put that on my list to explain it in more detail.

Thanks for the feedback!

q.

(There's a long story behind this 'q.'. Right now it looks a bit ridiculous to sign with q. instead of my real name. But it's shorter when posting.)
« Last Edit: July 13, 2012, 12:40:47 am by qwerty »

supplyondemand

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Question on the book "Scripting EA"
« Reply #2 on: July 14, 2012, 12:21:54 am »
Hi Thomas,

thank you for your response.

I would be grateful if you could explain the "Connection of Attributes" thing because I need it for a current project. I described some background here: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1342016515

Thanks a lot and best regards
Matthias

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Question on the book "Scripting EA"
« Reply #3 on: July 14, 2012, 04:11:10 am »
See the latest update in the Inside book. Chapter about StyleEx for Connectors:

Code: [Select]
LF<dir>P=<guid><pos>; connector attached to attribute/operation
<dir> = S or E meaning Start (source) or End (target)
<guid> = ea_guid of t_attribute or t_operation
<pos> = R if <dir>==S or L if <dir>==E
<pos>is obviously redundant...

You can manipulate the Style setting according to that schema.

E.g.
Code: [Select]
LFSP={158B2823-907B-4317-B83A-377D15F9B723}R; will connect an operation (in my model) at the source side of the connector.  And
Code: [Select]
LFSP={158B2823-907B-4317-B83A-377D15F9B723}R;LFEP={6D154121-C500-4d97-AA9C-4B4D6AF46504}L; will additionally connect an attribute (in my model) at the target side.

q.
« Last Edit: July 14, 2012, 04:12:23 am by qwerty »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Question on the book "Scripting EA"
« Reply #4 on: July 15, 2012, 09:43:43 am »
I have just added a sample code to create such associations in my book.

q.

supplyondemand

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Question on the book "Scripting EA"
« Reply #5 on: July 16, 2012, 05:46:25 pm »
Thanks a lot, highly appreciated!