views:

30

answers:

1

I have a class within a package. And I have another class in another package. I would like to link this second class to first. Since the first is a legacy of the second. I'm not able to make this relationship. We tried, but in neither case are the methods of the second brought the first.

Any help is welcome. Thanks

Class A
Class A

Class B
Class B

The ownership of Class A, should be visible within the class B. Where A and B are in different folders. And B, I put an "Instance" of A.

A: 

What sort of link are you trying to establish (what's the nature of their relationship), and for what purpose?

  • If one calls another directly then maybe you're after a dependency.
  • If it's inheritance then try a generalization link.

Edit: I haven't yet used EA for any forward-engineering so I'm not sure of the best way to do what you're after, but I did get it to partly work:

  • Form a link between to classes by dragging the new path arrow from the child class over the parent class.
  • From the context menu that pops up select generalization
  • The "Overrides and Implementation" dialog should appear.
  • Select the methods you want to bring across.

I tried this and it worked - but only for the methods not for the attributes I'd created.

Adrian K
@Adrian The purpose and I bring the methods and properties from first to second. inheritance of information. I tried what you told me of Generalization, but failed. Please see the photo above.
Ph.E