Book a Demo

Author Topic: Aggregates  (Read 1982 times)

derek73

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Aggregates
« on: February 20, 2006, 04:21:38 am »
If I show "Class A" aggregates "Class B", and "Class A"'s constructor takes a "Class B" object as one of the arguments, is it correct that I represent this relationship as an aggregate?

That is:
Code: [Select]

+---------+                          +--------+
|ClassA  |<>----|ClassB|
+---------+                          --------+

class classA:
  def __init__(self, b_object):
      ...


When I generate python code for this situation, EA creates a statement,

Code: [Select]

m_ClassB = ClassB()


and it's at the class scope level (I would expected it as self.variable = ClassB() under __init__(...) and only if I hadn't specified that variable class type in the constructor, or had specified a composition in UML).

So what am I not getting right?

Thanks!
« Last Edit: February 20, 2006, 04:27:20 am by derek73 »