Book a Demo

Author Topic: Cannot View Code in VS2005 partial class  (Read 3861 times)

Weedman

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Cannot View Code in VS2005 partial class
« on: April 12, 2006, 10:30:09 am »
I am using EA 6.1.789 and MDG Integration for VS2005.

Most of the UserControls I build in VB.NET have auto-generated partial classes in files named something like MyControl.Designer.vb.  The code I write goes into files named MyControl.vb.  These show up as two different classes of the same name in EA 6.1.789.

When I click "View Code" on the context menu in EA it works fine if I am trying to view the code for the EA class generated from MyControl.Designer.vb.   But if I try to "View Code" for the EA class generated from MyControl.vb (which is almost always what I want to do), EA takes me to the editor for  MyControl.Designer.vb in VS anyway.  If I try to "View Code" for a specific operation in the MyControl.vb class -- one that doesn't exist in MyControl.Designer.vb -- EA tells me it can't find it.

I have checked the file names in the class properties and they point to the correct files.  Any idea what I am doing wrong here?  I'd really like to be able to go directly to the code like I used to.
« Last Edit: April 12, 2006, 10:30:40 am by ea0705 »

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #1 on: April 12, 2006, 06:37:05 pm »
This is not just a VB. Net issue, I get the same behavior with C#.

I've read in another thread, can't locate it now, something todo with partial classes.  The advise their seemed to amount to don't use them -rather less than usefull.

Perhaps we should put in a feature request. Partial classes are a well usefull feature, the lack of support in EA is a considerable 'dis'

Stay tough
Kevin

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #2 on: April 12, 2006, 09:03:29 pm »
Quote
I've read in another thread, can't locate it now, something todo with partial classes.  The advise their seemed to amount to don't use them -rather less than usefull.

The other thread is somewhere in suggestions & requests, again based on one originally in the general board.  I cannot recall what I called them.

But....

Having now completed my mucking with VS2005 and their damned partial classes I have come to view the usefulness of partial classes as a little better than cholera.  

As a paraphrasing of what the Sparxian who replied in one of those threads said, I offer.  "These dogs are a half arsed attempt at getting around the problem of having masses of IDE generated code in immoveable and generally obtrusive positions in the class file."  

They are also, as we found, a great way to have 2 coders stuff up a critical release completely by working on two partials belonging to the same class at the same time.  

We've gone back to single class files thanks to that debacle.

On a different tangent,  I think Sparx should carefully decide whether EA is a modelling tool or a software generating CASE too.  My vote, for what its worth is "go back to being a modelling tool."

bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #3 on: April 12, 2006, 09:47:37 pm »
Quote
[size=13][SNIP][/size]
On a different tangent,  I think Sparx should carefully decide whether EA is a modelling tool or a software generating CASE too.  My vote, for what its worth is "go back to being a modelling tool."
[size=13][SNIP][/size]
My views on Modelling and Code Generation can be found elsewhere in the forum.

I took the view that it was better to use a modelling tool for the modelling and a code generation tool for the code generation.  The problem was how to link them in an appropriate way?  I found that my UMLPlus XML schema does the job pretty well...  We've used it with two modelling tools and two code generation tools (and five languages) so far.

An interesting aspect of this separation is that we can generate code in a more declarative fashion.  We provide our "intent" to the model, this intent is emitted onto the UMLPlus interface and the code generators interpret that intent in their context.

(As usual) I am in violent agreement with bruce.  ;)

Paolo
« Last Edit: April 12, 2006, 09:48:18 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Weedman

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #4 on: April 13, 2006, 09:23:07 am »
I can't really offer much of an opinion on what EA ought to do or be.   That is way beyond my competence.   All I'm really hoping is that, someday soon I hope, when I click on an operation in EA and select "View Code" it will take me to the code for that operation in VS2005.  

That would up my productivity a bit and make life a little easier.

By the way, I tried deleting the EA class related to the xxx.Designer.vb file, hoping that in its absence EA would look to the xxx.vb file, but no joy.  Anybody have any other workaround ideas?

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #5 on: April 13, 2006, 05:56:08 pm »
Cool, I think EA's a modeling Tool. Like it produces partial classes, why reverse engineer the Visual Designers' partial classes in the first place.

I suppose, the visual placement hints provided my some User Interfaceer Diagram might make an interesting Splash!! "Do a search on Cognative ;D) Pushing  UML boundaries indeed!! which culture?

Run time Simulators would be separate from modeling and production Tooling. Too yeah?

Stay tough
Kevin
« Last Edit: April 14, 2006, 02:22:00 am by badboyabout »

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Cannot View Code in VS2005 partial class
« Reply #6 on: April 19, 2006, 09:04:53 am »
Hi, have you tried using the same naming convention for the file name myClass.EA.cs. I'd try this when I getl back.

I think it's because EA won't generate 'partial' classes.

I really like the composite structure Diagram. Can you place packages in them ? That strikes me as being in Keeping with UML's use of Packages too.

How do you model (profile) Custom Attributes. Hunit for example

Hope Easter was full of goodies,
Stay tough
Kevin