Book a Demo

Author Topic: One Object Multiple Packages  (Read 4937 times)

easuperhero

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
One Object Multiple Packages
« on: March 31, 2015, 10:45:46 am »
I am sorry if this question has been asked before. I searched the forum but could not find an answer.

Is it possible to have an EA object (class,use case) in multiple different packages?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: One Object Multiple Packages
« Reply #1 on: March 31, 2015, 11:30:45 am »
Everything lives in a single Package. You can simulate multiple packages using the Model Views window.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: One Object Multiple Packages
« Reply #2 on: March 31, 2015, 11:34:06 am »
No. You can have instances or a clones of an object in different Packages, but not the exact same object. The replicates are separate objects. It's like a person - that person can only exist in one place, but you can have photographs or images of the person, or indeed identical siblings, in many places.
Best Regards, Roy

easuperhero

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: One Object Multiple Packages
« Reply #3 on: March 31, 2015, 12:45:36 pm »
I placed objects as instances in packages and used a ModelView object to display the objects in the package. This seems like a pretty good solution to me.

I just need to know how to extract the class name of an object?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: One Object Multiple Packages
« Reply #4 on: March 31, 2015, 02:21:51 pm »
Think you've picked up on something different than my suggestion.

Select  View | Model Views from the main menu.

This allows you to add multiple pseudo packages based on searches (eg. use a common keyword for elements to include) or by selecting exactly which elements you want.

easuperhero

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: One Object Multiple Packages
« Reply #5 on: March 31, 2015, 03:42:50 pm »
Ok I tried that and it seems to confuse me. However, I have found the following.

Quote
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_object.Scope, t_object.Status, t_object.Author FROM t_object INNER JOIN t_package ON t_package.Package_ID = t_object.Package_ID  WHERE t_package.ea_guid = '{3B89F121-F6E2-43b9-81DF-36020529310F}' ORDER BY t_object.Name

This is the SQL statement that displays a package as a list. How can I modify it to also show the class name of the object.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: One Object Multiple Packages
« Reply #6 on: March 31, 2015, 04:01:23 pm »
I'm not sure what you are trying to do, but I suspect that the answer you want is quite simple.

Read these two topics (and any others that are linked to them and that take your fancy):

http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/modeling_basics/objectclassifiers.html

http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/modeling_basics/pastingfromthetree.html

The name of the classifier displays on the object element in the diagram and in the Project Browser. If you name the object, the name displays as:

 <object name>:<classifier name>

I suppose we should ask the question: why did you want one object element to live in more than one Package?
« Last Edit: March 31, 2015, 04:09:58 pm by RoyC »
Best Regards, Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: One Object Multiple Packages
« Reply #7 on: March 31, 2015, 05:15:56 pm »
Quote
Ok I tried that and it seems to confuse me. However, I have found the following.

Quote
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_object.Scope, t_object.Status, t_object.Author FROM t_object INNER JOIN t_package ON t_package.Package_ID = t_object.Package_ID  WHERE t_package.ea_guid = '{3B89F121-F6E2-43b9-81DF-36020529310F}' ORDER BY t_object.Name

This is the SQL statement that displays a package as a list. How can I modify it to also show the class name of the object.

You need to make a join to the t_object table using ClassifierID = Object_ID

Something like this:

Code: [Select]
SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.Name, cl.Name AS ClassifierName,  o.Scope, o.Status, o.Author
FROM (( t_object o
INNER JOIN t_object cl ON cl.Object_ID = o.Classifier)
INNER JOIN t_package p ON p.Package_ID = o.Package_ID)
WHERE p.[ea_guid] = '{3B89F121-F6E2-43b9-81DF-36020529310F}'
ORDER BY cl.Name

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: One Object Multiple Packages
« Reply #8 on: March 31, 2015, 07:51:57 pm »
You should probably explain your goals. What do you want to see and why. I have no clue what you're trying to achieve.

q.

easuperhero

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: One Object Multiple Packages
« Reply #9 on: April 01, 2015, 10:50:38 am »
Quote
Geert Bellekens
Thank you very much sir.