Book a Demo

Author Topic: Newbie question  (Read 3345 times)

ObjectClassifier

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Newbie question
« on: October 18, 2009, 05:01:36 am »
Seems like this should be intuitively obvious...


I create an interface and define some operations.  I create a class and link the class to the interface via realization.  It asks me if I want to override the operations. I do.

Now I decide to change the signature in the interface of one of the operations.  Why does the linked class signature not change automatically?  How do I link the two so I don't have to change in both places?

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Newbie question
« Reply #1 on: October 18, 2009, 07:44:06 am »
Think about it this way.  Suppose you enter into a contract with an builder to build you a nice new house according to their "Palace1" plans.  So do 20 other people.  Now a year down the track, the builder changes his Palace1 plan to add a new dungeon.  Would you expect him to come round to your and the other 20 people and automatically add the new room, whether you or they wanted it or not?

A template is a "contract".  It has a specific meaning when executed, subsequent changes have no effect unless entered into again by each client.

You can use ctl+shift+O to redo the realization.  But keep in mind the above metaphore - it will "execute a new contract", the products of the old one will still remain.

hth
bruce

ObjectClassifier

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Newbie question
« Reply #2 on: October 18, 2009, 03:48:13 pm »
Thanks for the insight, however, interfaces do change and the implementing classes have to support those changes or they break the implementor contract.  

It appears that this tool does automate this change if you push the correct buttons in the right order.  However, what is the point in having a design tool that requires the same amount of work as making the changes to the code.

Why would I want to use this tool for code creation when it takes me as long to make the changes in the tool as it does for me to make the changes in my IDE.  Actually, I think I can use the IDE to make these changes automatically.  

I think there should be an option to have this automated to save time.  Just my humble 2 cents worth.  Interfaces are useful tools for OO and the tool should foster their use by making them easier to use.  IMHO.

Thanks for your reply.  At least I know that I'm not using the tool incorrectly. ;D

son-of-sargasso

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Newbie question
« Reply #3 on: October 18, 2009, 09:04:27 pm »
Quote
interfaces do change
No, they don't.  >:(
But this has been discussed ad nauseum about two years ago.  So, I'm not going to get into it again.
b

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Newbie question
« Reply #4 on: October 18, 2009, 11:42:21 pm »
Hi,

Look at this one:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1255617243

May be it helps you a little ...

WBR,
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

ObjectClassifier

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Newbie question
« Reply #5 on: October 20, 2009, 02:56:48 am »
Interfaces do change during initial development which is where I'm using this tool.  I agree, once an interface is published and in use, it should not change.  However, during initial creation, interfaces may change significantly and this tool does not make that easy to do.  I have found that it is not just a limitation of this tool, but others as well.  So, I rest my case and move on....

Thanks again for the insight.