Sparx Systems Forum

Discussion => General Board => Topic started by: Tompl on November 10, 2002, 11:35:47 pm

Title: Question - .NET framework classes
Post by: Tompl on November 10, 2002, 11:35:47 pm
Hello,
is some way to importing the .NET framework classes into EA?

Thanks for your ideas
Tom
Title: Re: Question - .NET framework classes
Post by: Jason Kaczor on November 22, 2002, 10:35:05 pm
There are a couple ways to do this using EA's automation facilities:

You could do the "base class library", which is not all of the framework, but a decent chunk, using the XML source, located at:
http://msdn.microsoft.com/net/ecma/
(scroll to the bottom of the page, there is a link for an XML file describing the BCL)

Or, alternatively, you could use "System.Reflection", and reflect/recurse through the framework classes, automating EA and creating packages for each namespace appropriately.

Hmm, I seem to recall Wrox's subscription site, "C# Today" recently had a series about using reflection to create UML models...
Title: Re: Question - .NET framework classes
Post by: Jason Kaczor on November 23, 2002, 11:01:29 pm
Here is the relevant article link from "C# Today", of course, I no longer subscribe...

http://www.csharptoday.com/content.asp?id=1837

Abstract
In this case study, Tony Loton looks at reverse engineering a C# program into a UML model, using the .NET System.Reflection classes to introspect a compiled assembly and a Rational Rose script to build an object model from the types and members that we discover. If you've been wondering about what reflection is and why you would ever want to use it, you'll see a really interesting application of that feature here. And if you're interested in reverse engineering .NET programs, you'll go away with a simple C# program / Rose script combination that will help you to do just that.  
Title: Re: Question - .NET framework classes
Post by: Jason Kaczor on November 24, 2002, 11:19:17 am
Ha;

Yet another follow-up:

Ok, http://www.lotontech.com/visualmodeling has the .NET Framework classes available as a Rose model for $30.

I'm checking to see whether or not he can provide an XMI export as well, then test w/EA.
Title: Re: Question - .NET framework classes
Post by: Jason Kaczor on November 27, 2002, 08:54:51 am
Ok, the author got in-touch w/me, and has a solution, the versions he provides for use with Visio are actually C# abstract definition code-files.

He sent me a sample, and EA imported it fine.  However, we it does not seem to support .NET-specific functionality ala "Properties", however ultimately it is still useful if you want to inherit from a base, or show interaction w/framework classes in a model.

So, for $30.00, I'm going to give it a shot.
Title: Re: Question - .NET framework classes
Post by: gsparks on December 03, 2002, 03:08:40 am
Hi,

The latest build (584) of EA has an additional option to import an XML 'library' file of .NET framework classes as mention by Jason in an earlier post on this thread:

http://msdn.microsoft.com/net/ecma/
(scroll to the bottom of the page, there is a link for an XML file describing the BCL)

The option is on the right click on a package in the project tree ... under import/export.

We plan to put together some reflection based examples in C# to create suitable XML files for import using this option. In the meantime you can use this to import the BCL at least.

Hope this helps,

Geoff Sparks





Title: Re: Question - .NET framework classes
Post by: Russ McClelland on December 13, 2002, 08:01:39 am
Is there a trick to importing this?  I encountered the following:

ERROR: Root package not found at: XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Package

Please cc my email address if you reply.

Thanks!
Title: Re: Question - .NET framework classes
Post by: timhawkins on December 14, 2002, 05:40:51 am
>>Is there a trick to importing this?  I encountered the >>ERROR: Root package not found at: >>XMI.content/UML:Model/UML:Namespace.ownedElement/UMLackage

I get the same error with the latest build, I have been carefull to makesure that the DTD path has been fixed up to match the place I have stored the All.xml file in, and I can now open the xml file in Internet Explorer, so the xml is fine.
Title: Re: Question - .NET framework classes
Post by: gsparks on December 14, 2002, 01:40:00 pm
Hi,

It sounds from the description you give that you have selected the wrong import function. The correct menu option to use is found by right clicking on a package, then going to the Import/Export submenu and choosing "Import .NET XML file". The error message sounds like the standard XMI importer.

The .NET XML files are not in XMI format - so a special function was supplied to import it.

Also NOTE! I have just downloaded the latest version of this file from the MS Website, and find it has been modified to include a hard coded DTD path ... although the DTD is supplied, the import will fail due to the hard coding of the DTD's location. You need to modify or comment out the DOCTYPE declaration at the start of the XML to get a clean import.

Hope this explains,

Geoff Sparks
Title: Re: Question - .NET framework classes
Post by: flyingrobots on January 05, 2003, 06:35:13 pm
Bummer...I imported the all.xml file, but alas...the System.Data namespace isn't in there...

Is there an update to this All.xml?  Or is reverse engineering in my future?   :)

Kevin
Title: Re: Question - .NET framework classes
Post by: Jason Kaczor on January 09, 2003, 01:04:16 am
>but alas...the System.Data namespace isn't in there...

I would hazard an educated guess that it isn't there, because it is a Microsoft proprietary namespace, and not submitted to ECMA for standardization, much like WinForms & WebForms...  System.Data = ADO.NET, right?

Title: Re: Question - .NET framework classes
Post by: DaveEchols on March 07, 2003, 01:00:59 pm
Has any more work been done on this? I have imported the BCL supplied on the MS site, but need objects/classes that are not in the BCL. I had looked at the possibility of using reflection in VB.NET to write out suitable XML files, but just don't know enough about the CLR to be able to get useful XML files.
Title: Re: Question - .NET framework classes
Post by: rescobar on March 13, 2003, 10:07:34 am
Import .NET XML runs ok (commenting out the DOCTYPE). But system.dat is missing. Is there another place to get an xml file with this namespace?
Thanks in advance
Sergio
Title: Re: Question - .NET framework classes
Post by: Dave Echols on March 24, 2003, 07:31:41 pm
I am very interested in this topic, and would be willing to look at any examples, do testing and help with coding of any examples that might make full .NET integration easier in EA.
Title: Re: Question - .NET framework classes
Post by: fcotroneo on March 26, 2003, 07:41:05 am

Thank you.

I imported all.xml too in an EA repository (SQL 2000) , and worked fine.

I am very interested in this topic as well, and in any examples, articles, codes and help that might make full .NET integration easier in EA.

We're starting using Visual studio Net, main language C#, and EA as modeling tool, to be used in UP projects.

Francesco Cotroneo
ASMTEL Settimo Torinese
Turin
Italy
email:franco.cotroneo@asmtel.it
Title: Re: Question - .NET framework classes
Post by: Isaac Citrom on March 30, 2003, 06:56:53 am
Hello all.

I am evaluating Enterprise Architect this week for use in our department.  From a 20 minute cursory inspection of the web site, it looks very impressive.  I'm quite excited about EA making an excellent replacement for Rose or XDE at one twentieth the cost per seat.

Reading this thread, I just wanted to add a word about the .NET libraries.

The Base Class Library (and this is a very informal term) includes all of the namespaces delivered by Microsoft with the framework.  So that includes, for example, the ADO.NET-related namespaces, such as System.Data and System.Data.SqlClient; the ASP.NET-related namespaces, such as System.Web.UI; etc.

Because the .NET framework is language agnostic, there is the notion of the Common Language Specification (CLS).  If you have a language in hand and want it to live in the .NET world, you must write your compiler so that it abides by the CLS.

Part of the CLS is the notion of the Common Language Infrastructure (CLI).  This is the base infrastructure that is required by your language implementation.  It includes the primitive types such as Int32.  In other words, we all know that any language implementation cannot exist solely on its syntax.  There must be some base abstractions on which to build.  Perhaps this is where the word "base" came into the picture.  In Microsoft's implementation of VB.NET, Int32 maps to the language key word Integer.

This base infrastructure maps to the ogical construct of the namespace System and is implemented in System.dll.  I took a look at the Xml file in question, and it looks like it is just about that.

For EA to really be of use during OOA&D, I believe we need the whole base class library; of course, each namespace in its own package.  I'll be evaluating EA this week.  I hope this task progresses.  If I recommend that we adopt EA, I will certainly want the base class library as part of our models.  If it hasn't been done, I'll create them using Reflection and export the information out to Xml or some other useful (to EA) format and post it here.

That said, Sparx Systems, is an upcoming version of EA to have this ready-made?  I would hate to go through the effort and finish just in time for it to be delivered on a silver platter by Sparx.

Isaac Citrom
Title: Re: Question - .NET framework classes
Post by: Ian Turner on April 27, 2003, 08:31:41 am
Hi,

I've written a quick WinForms app that can export .NET Assemblies in the format used by the EA importer.

http://iturner100.brinkster.net/freebies/Genista29.DotnetExporterForEA.Installer.zip

It constains an msi that installs the app and the source code as well, so you can fix / change it however you want. It's had hardly any testing but should work ok...

It was built on .NET 1.1 but doesn't use anything that can't be done with .NET 1.0.

There is no help so... The main form is a tree view with Library Nodes and Assembly Nodes. The library nodes will become the basic packages in EA. So, by default you get a single library (.NET Framework) with some of the standard assemblies under that.

You can add libraries and assemblies, rename libraries, drag and drop assemblies and delete libraries and assemblies.

Once you've set up the tree, you can generate the XML file - it can take a little while if you've added lots of assemblies.

It will prompt for where you want to save the generated xml.

Hope it helps all the .NETers out there!

Cheers
Ian
Title: Re: Question - .NET framework classes
Post by: jkaczor on May 01, 2003, 02:03:53 am
This looks good, but one question - did you install/build the setup program & utility with the .NET Framework 1.1 release, or the beta?

I've just tried installing 1.1 RTM available online, and still get an error message when I attempt to install your MSI.
Title: Re: Question - .NET framework classes
Post by: Ian Turner on May 01, 2003, 02:13:49 am
It is version 1.1.4322 which I assumed was the RTM release when I got it from the MSDN subscription. What is the error, anyway?
Title: Re: Question - .NET framework classes
Post by: jkaczor on May 01, 2003, 02:22:12 am
The exact error reads:

"This setup requires the .NET Framework version 1.1.4322.  Please install the .NET Framework and run this setup again.  The .NET Framework can be obtained from the web.  Would you like to do this now?"
Yes or No.

No exits, Yes takes me to:

"This Page Has Moved

We apologize for the inconvenience, but The URL you are trying to reach, http://msdn.microsoft.com/downloads.default.asp?url=/downloads/sample.asp?url=/msdn-files/027/002/055/msdncompositedoc.xml, has been moved from this location. You will be redirected to the new location in 5 seconds. Please update any bookmarks.
Thanks, The MSDN Team."

So, that's why I was inclined to think it was not the RTM version.
Title: Re: Question - .NET framework classes
Post by: tborland on May 05, 2003, 10:52:26 am
I've successfully downloaded and installed the ".NET Class Library Exporter for EA" but I'm running into some difficulty using it.

I manually added a new Library and then added assemblies under that library.

That all works fine, but when I attempt to export the assemblies that I added, I get the entire .NET library in the XML file.

Is this a bug in the Exporter, or am I using it incorrectly? Please let me know.

By the way, I love that tool and would like to see it take on a life of it's own!

Tim
Title: Re: Question - .NET framework classes
Post by: Ian Turner on May 06, 2003, 01:22:13 am
You probably need to remove the default library branch of the tree. Xml will be generated for whatever is in the tree, not just individual libraries. (The libraries are there just so that you can seperate the packages a bit in EA).

By the way, I've done a bit more testing and there are two problems with the Exporter tool. The first is that Interfaces are being imported as normal classes, and the second is that some of the modifiers (abstract, static etc.) are not being set.

I'm working on getting these fixed and a new version uploaded (hopefully within the next day or two).

Cheers
Ian
Title: Re: Question - .NET framework classes
Post by: Ian Turner on May 06, 2003, 05:24:53 am
A slightly updated version of the .NET Exporter has been uploaded. This correctly exports the xml for interfaces and access modifiers. It should also install without requiring .NET 1.1

Cheers
Ian
Title: Re: Question - .NET framework classes
Post by: DaveEchols on May 14, 2003, 05:59:20 pm
Couple of questions on the XML generator you have written. I have both 1.0 and 1.1 frameworks installed on my system. Which one is your utility reading and generating an XML file for? Also, there are many other assemblies included with the framework that are not listed with the standard ones you have included by default. Would it be possible to include all assemblies on a given system, with checkboxes or multiselect capability available in the treeview for selecting which ones to generate?
Title: Re: Question - .NET framework classes
Post by: jeremy.bunn on September 08, 2003, 07:25:34 am
Can someone email or post the dot net EA exporter?  It sounds like exactly what we need, but the link is broken above....

Thanks!
Title: Re: Question - .NET framework classes
Post by: Ian Turner on September 08, 2003, 09:30:39 am
It's not hosted anywhere at the moment - I can mail it to you if you like...
Title: Re: Question - .NET framework classes
Post by: Sean Kearon on September 09, 2003, 03:49:12 am
Hello Ian

I would like a copy too, please feel free to email it to me when you get a chance.

Thanks

Sean
Title: Re: Question - .NET framework classes
Post by: Ian Turner on September 09, 2003, 03:54:33 am
OK. Anyone who wants a copy emailed to them, can you email me at i.turner@syzygy.net and I'll mail you back...

The installer will also give you the source code so feel free to muck about with it as much as possible.

I'm too busy with work to do any more on it, I'm afraid. If someone wants to take up ownership / hosting, you are more than welcome.

Cheers
Ian
Title: Re: Question - .NET framework classes
Post by: Darren Lock on September 09, 2003, 08:28:59 am
I placed Ian's utility at Darren's Garage http://www.darrensgarage.com/DesktopDefault.aspx?tabid=64 for download.


If anybody modifies this then they are more than welcome to send me the updated file.
Title: Re: Another site is 'down'
Post by: AdamHearn on September 10, 2003, 02:43:54 am
My site is always up and running... what's the betting of it being true when someone tries to grab the file ::)

Go grab the file from here (http://www.adamhearn.co.uk/files/Genista29.DotnetExporterForEA.Installer.zip)
Title: Re: Question - .NET framework classes
Post by: Darren Lock on September 10, 2003, 05:36:24 am
Folks,

sorry about Darren's Garage being down. There was a power failure, first one in 6 years. Maybe I should invest in a UPS!
Title: Re: Question - .NET framework classes
Post by: jeremy.bunn on October 14, 2003, 05:06:58 pm
The download seems to be broken.  All I get is a gif file when trying to pick up the utility.  Any ideas of another place to get this?   ???
Title: Re: Question - .NET framework classes
Post by: DaveEchols on October 14, 2003, 06:45:35 pm
I have uploaded it to my site. Hope you have better luck with it than I had. Not very good at doing large sets of classes.
   Dave

http://www.davidechols.com/download/Genista29.DotnetExporterForEA.Installer%20A.zip
Title: I meet an exception when I export the class
Post by: palatum on October 15, 2003, 06:49:47 pm
When I running the .Net Class Liberary Expoter, I meet an exception,  ???the info listed below. Please help me.

OS : Windows 2000 Professional (SP3) Chinese Version
.Net: Visual Studio .Net 2003 Chinese Version (SDK Version : 1.1.4322)
EA : 3.51.606
The exception text:

************** Exception Text **************
System.InvalidCastException: 接口 EA.IDualRepository 的 QueryInterface 失败。
  at EA.RepositoryClass.ShowWindow(Int32 Show)
  at Genista29.DotnetExporterForEA.WinForms.Xml.ClassLibraryXmlBuilder.GenerateXml(BindingFlags flags)
  at Genista29.DotnetExporterForEA.WinForms.MainForm.menuItemFileGenerateXml_Click(Object sender, EventArgs e)
  at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
  at System.Windows.Forms.MenuItemData.Execute()
  at System.Windows.Forms.Command.Invoke()
  at System.Windows.Forms.Control.WmCommand(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  at System.Windows.Forms.ContainerControl.WndProc(Message& m)
  at System.Windows.Forms.Form.WndProc(Message& m)
  at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** The Loaded Assembly **************
mscorlib
   Assembly Version Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
Genista29.DotnetExporterForEA.WinForms
   Assembly Version: 1.0.1346.29632
   Win32 Version: 1.0.1346.29632
   base code: file:///C:/Program%20Files/Genista%2029/.NET%20Class%20Library%20Exporter%20for%20EA/Genista29.DotnetExporterForEA.WinForms.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.dll
----------------------------------------
System.Data
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.data.dll
----------------------------------------
System.Design
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.design.dll
----------------------------------------
System.Drawing
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.drawing.dll
----------------------------------------
System.Web
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.web.dll
----------------------------------------
System.Web.Services
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.web.services.dll
----------------------------------------
System.Windows.Forms
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.windows.forms.dll
----------------------------------------
System.Xml
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/microsoft.net/framework/v1.1.4322/system.xml.dll
----------------------------------------
System.Xml
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Interop.EA
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.0.0
   base code: file:///C:/Program%20Files/Genista%2029/.NET%20Class%20Library%20Exporter%20for%20EA/Interop.EA.DLL
----------------------------------------
mscorlib.resources
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/mscorlib.resources/1.0.5000.0_zh-chs_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
   Assembly Version: 1.0.5000.0
   Win32 Version: 1.1.4322.573
   base code: file:///c:/winnt/Assembly Version/gac/system.windows.forms.resources/1.0.5000.0_zh-chs_b77a5c561934e089/system.windows.forms.resources.dll
----------------------------------------