+  Flower Platform
|-+  Development
| |-+  Feature Requests
| | |-+  MXML component representation
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

« previous next »
Pages: [1] Print
Author Topic: MXML component representation  (Read 4029 times)
Alan G.
Newbie
*
Posts: 9


« on: May 12, 2011, 11:39:42 AM »

MXML separates component declaration from the class declaration.  Example: MyWindow (a Window) with a declared
Code:
<s:Button id="MyButtton" />
is a composition, but until compilation, these members are not part of the *real* class.  Thus it is not seen as anything except its ActionScript members by UML4AS when reverse engineered.

If you compile MyWindow.mxml with -keep, you can see the generated interface and declaration ActionScript files, its that interface (MyButton will become a public var of the MyWindow class there).  I'd like to see the generated interface become part of my graphical classes, perhaps in a separate section for clarity.  Is this doable at the moment?
« Last Edit: May 12, 2011, 11:56:46 AM by Alan G. » Logged
Cristian
UML4AS Architect
Administrator
*****
Posts: 284



« Reply #1 on: May 12, 2011, 12:18:29 PM »

Hello Alan,

I think I understand. But could you give an example: MXML Source -> generated elements (by -keep) -> what exactly would you like to see in the model?

Regards,
Cristian.
Logged
Alan G.
Newbie
*
Posts: 9


« Reply #2 on: May 12, 2011, 02:42:41 PM »

Hi Cristian,

By -keep I mean the compiler argument for mxmlc, which seems to work as an alias for keep-generated-actionscript=true.

Here is some example code to better explain what I mean.
Code:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
creationComplete="creationComplete(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
public var station: int;

protected function btnRockTheCasbah_click(event:MouseEvent):void
{
station++;
}

protected function creationComplete(event:FlexEvent):void
{
station = 0;
}
]]>
</fx:Script>
<s:Button x="10" y="10" id="btnRockTheCasbah" label="Rock the casbash"
click="btnRockTheCasbah_click(event)"/>
</s:Group>

Now when I drop MyGroup into a diagram I see only 3 elements; the station property (attribute) and the two event handler methods (operations).  All these elements come out of the <Script /> section, the MXML-declared components are ignored.  btnRockTheCasbah is missing; it is only added to the class at compilation by mxmlc.

So I'd like to have the MXML-declared components like that button added to the UML class nodes.
Logged
Cristian
UML4AS Architect
Administrator
*****
Posts: 284



« Reply #3 on: May 12, 2011, 05:02:16 PM »

Dear Alan,

We will add this feature in a future release of UML4AS.

Best regards,
Cristian.
Logged
Alan G.
Newbie
*
Posts: 9


« Reply #4 on: May 12, 2011, 05:12:25 PM »

Thanks, looking forward to it.
Logged
DivideByZer1
Newbie
*
Posts: 2


« Reply #5 on: November 01, 2011, 04:33:15 AM »

I think I'm having the same problem here (complete beginner):

When i try to add the main class of the project (an mxml file) to the diagram, and I try to "Display missing elements and add relations", it only shows "WindowedApplication" with the "generalization" arrow.  However, reverse engineering works fine for standard .as files.  I was wondering if I was doing something wrong, or if there's a potential workaround for this.  (I'm working on a project with very poor commenting and documentation, so I'm trying to figure out what's inheriting from what without having to map it out manually, if possible)
Logged
Cristina
Flower Platform Developer
Global Moderator
*****
Posts: 66



Email
« Reply #6 on: November 01, 2011, 11:39:57 AM »

Hello,

Could you please tell us what kind of relations/elements did you expected to see and they weren't displayed after running "Display missing elements and add relations"?

Best regards,
Cristina
Logged
DivideByZer1
Newbie
*
Posts: 2


« Reply #7 on: November 02, 2011, 02:08:39 AM »

Well I don't have the code in front of me now but it would only show inheritance between .as files, .mxml files would only show the graphical components associated with them when I clicked for it to show dependencies (such as PopupWindow or something, I don't remember exactly.)  I can post a bit of the code tomorrow, although if there's any part in particular you think would help let me know.
Thanks
Logged
Cristina
Flower Platform Developer
Global Moderator
*****
Posts: 66



Email
« Reply #8 on: November 02, 2011, 11:09:15 AM »

Hi,

When classes are reverse engineered, dependencies are not created because there isn't a source code sequence from where they can be taken.

Only inheritance relations (such as generalizations and interface realizations) are created automatically.
For more information, please take a look at this post:
http://www.uml4as.com/forum/index.php?topic=97.msg343#msg343

Best regards,
Cristina

Logged
Pages: [1] Print 
« previous next »
Jump to:  
anything