Book a Demo

Author Topic: Help with classes and interfaces  (Read 3101 times)

howlingfang

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • Yaaaaa aaaaarrrrrrgggg hhhh!!!!!!
    • View Profile
Help with classes and interfaces
« on: November 22, 2005, 10:00:37 am »
I have a class diagram with an interface and a class which realizes it.  How do I get the class to automatically update to show a method that I add to the interface?

I have tried to just add the method to the interface, but the class doesn't change at all.

Thanks,

Fang

thomaskilian

  • Guest
Re: Help with classes and interfaces
« Reply #1 on: November 22, 2005, 12:28:45 pm »
Changing the interface is like breaking a contract. Thus you have to explicitely go to the realizing classes and promote the changes. There are some current threads about interfaces in this forum.

howlingfang

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • Yaaaaa aaaaarrrrrrgggg hhhh!!!!!!
    • View Profile
Re: Help with classes and interfaces
« Reply #2 on: November 22, 2005, 01:12:30 pm »
Except that I am in design and my interfaces are changing every 15 minutes as I add and delete methods.  

Are you saying there is no way to have all the classes that implement an interface automatically update when I make changes to them?  That makes it pretty useless as a design tool...and frankly the "contract" arguement seems pretty spurious as even my IDE will automatically propagate a new method added to an interface to the implementing classes.

Anyone else?

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Help with classes and interfaces
« Reply #3 on: November 22, 2005, 03:19:50 pm »
Quote
That makes it pretty useless as a design tool...and frankly the "contract" arguement seems pretty spurious


with the greatest possible respect .... bullshit.

If you are designing the interfaces why are you building the classes at the same time.
« Last Edit: November 22, 2005, 03:20:14 pm by sargasso »
"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.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Help with classes and interfaces
« Reply #4 on: November 22, 2005, 04:09:05 pm »
If you're using EA's code generation, how about never explicitly implementing the methods in EA.  (So the class diagrams won't show the methods in the implementing classes)  You can then specify that the code engineering should create these methods when generating a class.  

The option can be found under Tools | Options | Source Code Engineering | Attribute/Operations | Generate methods for implemented interfaces.

howlingfang

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • Yaaaaa aaaaarrrrrrgggg hhhh!!!!!!
    • View Profile
Re: Help with classes and interfaces
« Reply #5 on: November 23, 2005, 08:16:09 am »
Quote

with the greatest possible respect .... bullshit.

If you are designing the interfaces why are you building the classes at the same time.



Perhaps it never occurred to you that people do design different ways.  One of the things that attracted me to EA was that it didn't seem to force you into a particular methodology like Rational does.

Since you asked I have to reply.  I have designed a simple skeleton of an interface that I know I will have various implementing classes.  The way that I design is to jump into a sequence diagram and see what functionality I require as I flow through the system.  In order to create the sequence diagram I need implementing classes.  As I discover my functionality, I add it to the interface and expect the implementing classes to automatically update.

Frankly any arguement of "how" design should be done as a defense for the lack of a simple feature in the application just doesn't hold water for me.  I am not the only one that would think that this feature would be useful (as evidenced by other forum posts) and provided it can be turned on and off it would meet all users needs, not just your perceived "ideal" methodology.

Just give me a system setting to "Automatically add new interface methods to implementing classes" and set it "Off" as the default.  I'm just asking for the feature, as others are, because it's lack is an inconvenience to my workflow.

Fang

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Help with classes and interfaces
« Reply #6 on: November 23, 2005, 03:31:41 pm »
FAQ

Main menu | Element | Advanced | Override Implementation
(Ctl)-(Shift)-O

What I objected to was your specious statement quoted.  I am well aware of EA's strength in its flexibility.  The lack of said "feature" IMO does not render the product useless nor does your statement on the contractual nature of interfaces reflect to me a good understanding of what I consider to be good design practices.

Finally, as a matter of interest, what IDE are you using?  I'd like to eliminate it as a possibile recommendation to my clients.
« Last Edit: November 23, 2005, 05:56:58 pm by sargasso »
"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.