Book a Demo

Author Topic: Thoughts about Containers & Containment.  (Read 13320 times)

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Thoughts about Containers & Containment.
« on: October 09, 2005, 10:30:39 pm »
I'm having some trouble getting a proper mental grip on the concepts of Container & Containment.  Can you help?

In a physical sense, I can understand the concept of a castle being a container, and being within a castle as a form of containment.  While in the castle, I am nurtured by the master of the castle and protected from forces exterior to the castle; the master is the steward (i.e.;  the careful and responsible management of something entrusted to one's care ) of my existence.

Where I get into trouble is when I abstract these concepts into a logical realm and try to think crisply about them in a CIM way. I think the [size=13]Java Tutorial[/size] on Collections provides a good starting point for clearing up my thoughts.  Please, take a look (two pages ought to do it) and let me know if you agree that the abstract concepts presented there map well into the UML Context as a CIM.  Don't spend time on the Java implementation code unless it it helpful to you;  I'm only interested in the abstract concepts presented therein.  

My concerns are:
  • Are Collections a specialization of Container? (Default = no, they are synonyms.)
  • Do you agree that a Nest is a specialization of physical Container (default = yes), and further, can a Nest be a specialization of a logical Collection (Default no, this is a mixed metaphor)?
  • With the possible exception of a nest, saying that a object "A" is contained by object "B" does not mean we are modeling the concept that "A" is physically within a "B", but that we are saying that "A"s features fall within a defining boundary criteria allowing it to participate, along with other objects, in an association that is logically hosted by an object named "B".  Am I making the distinction clear here? Is there a better way to say this?
  • Do you accept the abstractions of the Collections Framework at the CIM level? (Default = yes)
  • If all of this is good so far, then my questions have been answered.


Verbal Use Cases aren't worth the paper they are written upon.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #1 on: October 10, 2005, 05:51:49 am »

Quote
Are Collections a specialization of Container? (Default = no, they are synonyms.)


in weak definition and mostly in the real world - yes (synonyms), but if to be precise - no

Quote
Do you agree that a Nest is a specialization of physical Container (default = yes), and further, can a Nest be a specialization of a logical Collection (Default no, this is a mixed metaphor)?


then we go down to the physical world, we're influenced by technology (C#, Java, metal, wood), policies or plenty other things. How to describe physical container governs requirements, technology, mood & etc.

at first I will state, that nest is a container. Logical container (perfect container) supports many collections inside. Physical container (real examples) also can support many inside collections, but how to support them (collections) is a question of technology and methodology. It's also possible, that real container won't support this (workaround - combine several real containers)

Other thought - actually every domain can have it's own stereotypes/meronymies - memberOf, partOf, portionOf and so on. Only view on the domain will refine it's meaning. Without context meronymies are synomyms. I think, that these features grouping, access and ownership are really matter.

Coming back to nest - it's a container, with certain access, ownership and grouping (sometimes only logical) policies, where strong point made in ownership (living environment) aspect.
registertm everything to SparX

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #2 on: October 10, 2005, 10:22:53 pm »
Quote
Without context meronymies are synomyms.
I think this is a very astute statement!  It has helped clarify things for me.

Verbal Use Cases aren't worth the paper they are written upon.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #3 on: October 14, 2005, 06:42:15 am »
Quote
I'm having some trouble getting a proper mental grip on the concepts of Container & Containment.  Can you help?

In a physical sense, I can understand the concept of a castle being a container, and being within a castle as a form of containment.  While in the castle, I am nurtured by the master of the castle and protected from forces exterior to the castle; the master is the steward (i.e.;  the careful and responsible management of something entrusted to one's care ) of my existence.
I think we need to be clear about the implications of the CIM (Computationally Independent Model).  The target domain can only be the real world.  Thus if we are defining abstractions and other definitions that we wish to apply to the CIM, they have to be valid for the Real World model.  Thus, your use of the castle as an example is perfectly valid and appropriate!
Quote
Where I get into trouble is when I abstract these concepts into a logical realm and try to think crisply about them in a CIM way. I think the [size=13]Java Tutorial[/size] on Collections provides a good starting point for clearing up my thoughts.
I think this is where we start having problems.  While it is a starting point, if we don't recognise that computer languages are very limited (both syntactically and semantically), we run the risk of limiting ourselves.  One of my colleagues at work, Vince Phillips (and a manager no less!) made the very astute observation that we are limited in our thinking by the language that we use.  He was speaking generally, but the observation is most valid for computer languages.
My view is that we should be able to construct an abstraction that is valid for the CIM and via (possible) transformations be also applicable to the PIM (Platform Independent Model), PSM (Platform Specific Model) and the applicable code.
An example of the language limitation I referred to is the statement: Note also that the hierarchy consists of two distinct trees: a Map is not a true Collection.  This is patent nonsense!  Maps are just different kinds of collections.  In my ontology there are two principal types of Collections:  Sequenced Collections (which include (some of) those types on the left tree: List, Queue) and Associative Collections (which include those types on the right hand tree: Map and Set - from the left...)
Quote
Please, take a look (two pages ought to do it) and let me know if you agree that the abstract concepts presented there map well into the UML Context as a CIM.  Don't spend time on the Java implementation code unless it it helpful to you;  I'm only interested in the abstract concepts presented therein.
Here, Jim, you make the correct observation that one shouldn't spend time on the Java.  I'm going further, I'm saying that the semantics of a coding language change the uses that certain concepts are put to.  So long as we are aware of that, we can proceed with the appropriate caution.
In addition, much documentation created by people on the net is very sloppy...
Quote
My concerns are:
  • Are Collections a specialization of Container? (Default = no, they are synonyms.)
Yes, Collection is NOT a specialization of Container.  But They aren't synonyms either.  As I (in a Homer Simpson moment ;D) observed [size=13]elsewhere[/size]: Collection is about grouping, Containment is about access They are orthogonal concepts.
Quote
[/list]
  • Do you agree that a Nest is a specialization of physical Container (default = yes), and further, can a Nest be a specialization of a logical Collection (Default no, this is a mixed metaphor)?
See! You said it yourself! ;)
Quote
[/list]
  • With the possible exception of a nest, saying that a object "A" is contained by object "B" does not mean we are modeling the concept that "A" is physically within a "B", but that we are saying that "A"s features fall within a defining boundary criteria allowing it to participate, along with other objects, in an association that is logically hosted by an object named "B".  Am I making the distinction clear here? Is there a better way to say this?
I think we need to be careful here.  bruce (sargasso) pointed out in his post on [size=13]Ownership[/size] we need to differentiate between instance containment and classifier containment.  I make that distinction in observing that while a class might be nested in more than one other class.  The instance is only ever physically in one containing instance.
Getting back to Containment... And Castles.;D  The Castle is the container.  The master of the the castle isn't (and hasn't got anything to do with containment).  When I'm in the castle, I'm not in another castle.  I think that's the essence of containment.
For a given Class, if I can only be in one Instance of that Class at a time, then the Class is a Container, otherwise it isn't.
Quote
  • Do you accept the abstractions of the Collections Framework at the CIM level? (Default = yes)
  • If all of this is good so far, then my questions have been answered.
As I said above, This isn't relevant.

Now do you see why the Java Collections article isn't useful?

Apart from the first sentence: A collection — sometimes called a container —  There is actually NO mention of containment (that which containers do) in the article.
Perhaps the article should start: A collection — sometimes (erroneously) called a container — ...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #4 on: October 14, 2005, 11:35:00 am »
Quote
Now do you see why the Java Collections article isn't useful?
In the context of Container discussions, I agree.  Do you have thoughts on the article's relevance in a Collection discussion context?

Quote
we are limited in our thinking by the language that we use.
Very astute!  As an aside, I would add: "we are also limited by the number of dimensions by which we measure our reality."  I often fall into this trap of constrained thinking; which is why I'm trying to be very precise in verbalizing my questions.

Quote
I think we need to be clear about the implications of the CIM (Computationally Independent Model).  The target domain can only be the real world.  Thus if we are defining abstractions and other definitions that we wish to apply to the CIM, they have to be valid for the Real World model.
I intuitively understand the concept of a CIM, but have you posted an explicit list of attributes of a CIM or can you give me a URL to one?

Quote
My view is that we should be able to construct an abstraction that is valid for the CIM and via (possible) transformations be also applicable to the PIM (Platform Independent Model), PSM (Platform Specific Model) and the applicable code.
Clearly, having a valid CIM is of utmost importance, for errors in the CIM will probably be propagated through the transformations to the source code.  Have you formalized your thoughts on how to validate a CIM (both as being a proper CIM and as being a valid model of reality)?  I suspect that articulation of the business rules vs articulation of the model plays a big part in this, but that begs the question of the validity and completeness of the business rule collection.

Quote
I think we need to be careful here.  bruce (sargasso) pointed out in his post on Ownership we need to differentiate between instance containment and classifier containment.  I make that distinction in observing that while a class might be nested in more than one other class.  The instance is only ever physically in one containing instance.
Getting back to Containment... And Castles.  The Castle is the container.  The master of the the castle isn't (and hasn't got anything to do with containment).  When I'm in the castle, I'm not in another castle.  I think that's the essence of containment.
For a given Class, if I can only be in one Instance of that Class at a time, then the Class is a Container, otherwise it isn't.
I like all of you comments here in the context of modeling a physical entity such as a castle.  But a class, in UML, may also model a non-physical entity such as an intellectual  concept.  Does your ontology allow for this?  Not sure I have an example of this...

Oh Paolo!  What your comb is doing to the knots in my brain! ;)  In searching for an example of an intellectual concept that might be contained, I came across this in Wikipedia:
Quote
A semantic class contains words that share a semantic property. Semantic classes may intersect. The intersection of female and young can be girl.
Now I want to rewrite this as: "Words that share a semantic property are members of a semantic group"   See?  I'm learning! 8)

So then I tried to model the semantic properties of the concept of Man as a classifier:
Quote
Man is [+HUMAN], [+MALE], [+ADULT]
, but this is an example of a composite (concept of MAN) having shared, but intrinsic parts (concepts of HUMAN, MALE, and ADULT).

So now I'm not sure...do you consider:
  • Group and collection to be synonyms? Do I detect a subtle difference?
  • A composite to be a type of container? and,
  • Can the features of a classifier be a union of the features of container and of group?


Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #5 on: October 14, 2005, 10:13:50 pm »
Quote
In my ontology there are two principal types of Collections:  Sequenced Collections (which include (some of) those types on the left tree: List, Queue) and Associative Collections (which include those types on the right hand tree: Map and Set - from the left...)
Quote
So now I'm not sure...do you consider:

Group and collection to be synonyms? Do I detect a subtle difference?


Paolo, I need to think about the implications of our quotes above and get my thoughts better organized.  Instead of responding here on collections, let me start a Collections thread.
Verbal Use Cases aren't worth the paper they are written upon.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #6 on: October 16, 2005, 02:50:03 am »
Quote
[size=13][SNIP][/size]
So now I'm not sure...do you consider:
  • Group and Collection to be synonyms? Do I detect a subtle difference?
Collection as a group of items.  {several things grouped together or considered as a whole}  The Collection is the whole, the items are connected to the whole by «memberOf» Associations.
Quote
  • A composite to be a type of container? and,
Sounds like it...
Quote
  • Can the features of a classifier be a union of the features of container and of group?
I think that's my point...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #7 on: October 16, 2005, 03:21:30 am »
[
Quote
[size=13][SNIP][/size]
I intuitively understand the concept of a CIM, but have you posted an explicit list of attributes of a CIM or can you give me a URL to one?
[size=13]Introduction to Model Driven Architecture[/size] has a good introduction (although it's a bit long).
Quote
Clearly, having a valid CIM is of utmost importance, for errors in the CIM will probably be propagated through the transformations to the source code.  Have you formalized your thoughts on how to validate a CIM (both as being a proper CIM and as being a valid model of reality)?  I suspect that articulation of the business rules vs articulation of the model plays a big part in this, but that begs the question of the validity and completeness of the business rule collection.
[size=13][SNIP][/size]
In Rose (and my previous Conceptual Modelling Tool), I had a set of tests that I used to help determine if my model was valid (well at least self-consistent);D.  But, most of it was connected with my particular style of modelling.  I haven't converted my Rose stuff to EA yet.  However, I am interested in exploring this so that when I refactor for EA, it will be a better checker...

Maybe a thread on MDA or CIM may be appropriate.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #8 on: October 16, 2005, 07:35:02 am »
Quote
Collection as a group of items.  {several things grouped together or considered as a whole}  The Collection is the whole, the items are connected to the whole by «memberOf» Associations.
Sounds like it...
I think that's my point...

Paolo
I think I understand now!

I now perceive the term Collection to be an abstraction level up from meronymic wholes we've been discussing and several levels up from the classifiers having these features.

Quote
[SNIP]Quote:we are limited in our thinking by the language that we use.  
Very astute!  As an aside, I would add: "we are also limited by the number of dimensions by which we measure our reality."
I'm now adding "and I'm limited by the number of abstraction levels I can use concurrently in a single statement."  :'(  I gotta work on this!  ;D
Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #9 on: October 16, 2005, 07:48:14 am »
Quote
Introduction to Model Driven Architecture has a good introduction (although it's a bit long).
This is exactly what I needed.  Thanks!.

Quote
[SNIP]Maybe a thread on MDA or CIM may be appropriate.
Yes I agree, but I think, rather than at the thread level, as a UML peer at the discussion level?

Discussions on model validation may be more than I can handle at the moment; I'm focused on getting the model correct first, then validating it (from a learning perspective, not a model development perspective) ;D  
Verbal Use Cases aren't worth the paper they are written upon.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #10 on: October 16, 2005, 02:16:03 pm »
Quote
The target domain can only be the real world


not true in MDA ;-) - can use refactoring on PIM-to-PIM (CIM-to-CIM  ;) ) transformations

registertm everything to SparX

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #11 on: October 16, 2005, 03:01:51 pm »
Quote

not true in MDA ;-) - can use refactoring on PIM-to-PIM (CIM-to-CIM  ;) ) transformations

Sorry, wasn't clear enough.   You are correct that refactoring can be used as you say.  
All I was saying was the the domain of the CIM was the real world.  Where we say "person" in the CIM we mean a real person, not the class representing the person.  I hope I'm clearer this time around... :D.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #12 on: October 20, 2005, 05:12:45 pm »
Quote
Paolo, I need to think about the implications of our quotes above and get my thoughts better organized.  Instead of responding here on collections, let me start a Collections thread.
Jim, the tutorial on collections you previously referenced has disappeared.  You seem to get redirect to buy some Sun books... ;D

When you start a new thread on collections, bear that in mind.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #13 on: October 20, 2005, 07:01:49 pm »
This is totally amazing!   ???

The entire Sun Tutorial site has disappeared!   :'(  This is so surprising that I'm wondering if the site has been hijacked!  :-/  From the comments in the Sun forum, I don't think so.

Over on the Sun Forum there is loud consternation about this from many individuals.  I think Sun will be very sorry they took that approach.  That site was the foundation resource for many, many college courses here in the US.

I'll be sure to take this into consideration in the future.

Thanks for the heads up!
Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Thoughts about Containers & Containment.
« Reply #14 on: October 20, 2005, 08:32:20 pm »
Paolo,
I have the missing tutorial in my archives.   :)

After work tomorrow, I'll start the process of publishing them on my web site.  Just the two pages I referenced.  I don't have the bandwidth to become the new tutorial site.  ;D

When I get the pages published, I'll go back and change the link in my first post in this tread.

Again, Thanks for letting me know about this.
Verbal Use Cases aren't worth the paper they are written upon.