Jump to content

Talk:Object composition: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
DrHok (talk | contribs)
→‎Multiplicity: owning end of composistion must be 1
Line 13: Line 13:
--[[User:Mjchonoles|Mjchonoles]] 13:53, 18 May 2006 (UTC)
--[[User:Mjchonoles|Mjchonoles]] 13:53, 18 May 2006 (UTC)
: Done. [[User:Rjgodoy|Rjgodoy]] 18:02, 3 April 2007 (UTC)
: Done. [[User:Rjgodoy|Rjgodoy]] 18:02, 3 April 2007 (UTC)
:: I believe that 0..1 is not correct for the owning end of a composition. Only 1 should be possible, because the contained objects can only exist if the owning object exists. (There can be zero owning objects, but only if there are zero owned objects, in which case the relation is meaningless.) BTW: The [[de:Assoziation (UML)|German wikipedia]] shares this POV. --[[User:DrHok|史慧开]] ([[User talk:DrHok|talk]]) 14:16, 9 September 2009 (UTC)


== Splitsing of aggregation ==
== Splitsing of aggregation ==

Revision as of 14:16, 9 September 2009

WikiProject iconComputer science Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

Composition versus Inheritance

It would be interesting if somebody would add a small section discussing this. A Google search on this topic suggests that these are comparable solutions to the same problem of class relationships, except the composition allows for runtime hierarchy management. An example demonstrating this comparison would be interesting. --Daydreamer302000 (talk) 08:01, 11 May 2009 (UTC)[reply]

Code associated with UML diagram

Below the UML diagram, there is a piece of code showing composition: a car is composed of one carburetor. The car class however, contains a pointer to a carburetor. This is in contrast with the code examples in the point above, where is stated that composition uses an 'object within object' structure, whereas aggregation uses a reference/pointer to the object. In my opinion, if I have understood correctly, the car/carburetor example should be without pointer. it also shows what the sun is. --Patrickdepinguin 19:05, 18 June 2006 (UTC)[reply]

Multiplicity

The UML samples should be given multiplicity. On the owning (diamond) end of the association, for aggregation, the multiplicity, can be any multiplicity (except for 0..0), including 1, 0..1, 0..*, and *. For composition, the owning end can only be 1 or 0..1 --Mjchonoles 13:53, 18 May 2006 (UTC)[reply]

Done. Rjgodoy 18:02, 3 April 2007 (UTC)[reply]
I believe that 0..1 is not correct for the owning end of a composition. Only 1 should be possible, because the contained objects can only exist if the owning object exists. (There can be zero owning objects, but only if there are zero owned objects, in which case the relation is meaningless.) BTW: The German wikipedia shares this POV. --史慧开 (talk) 14:16, 9 September 2009 (UTC)[reply]

Splitsing of aggregation

I think aggregation should get its own article and that composition should only mention the differences briefly...

Record (database)

The subject "Record (database)" redirects here, but this page is rather complicated. I recommend an article under "Record (database)", with a link to this page, rather than a redirect. D021317c 05:56, 21 March 2007 (UTC)[reply]

Already redirected to Row. --Kubanczyk 19:08, 18 October 2007 (UTC)[reply]

UML Notation merged with text after introduction

The final paragraph of introduction had been copied as "UML Notation" (near the end of the article). "Aggregation" section also has an UML diagram, so "UML Notation" must be introduced before. Rjgodoy 01:37, 17 April 2007 (UTC)[reply]

No assembler in timeline

Assembler is definately the source of whole idea of "record". Could someone add assembler code as the first item in the timeline? Unfortunately I don't know any pre-COBOL assembler, such as S/360, but it would be perfectly logical here (I guess even zSeries would be better than nothing). --Kubanczyk 19:16, 18 October 2007 (UTC)[reply]

IMHO, records in assembler are just a region of memory plus an implicit convention of using such region for storing certain kind of data (nibbles, BCD, bit-flags, etc). I mean there is no assembler notation for declaring "records" besides the directives for reserving memory. Rjgodoy 15:28, 19 October 2007 (UTC)[reply]

Well, even if there would be no dedicated assembler notation (and I assure you that in many assemblers there is one), this programming concept (a record) originated around 1950s from the fact that assembly programmers liked to keep related variables close to each other in the memory, not scattered all over the address space. It may seem trivial now, but it's much more important observation than a syntax of some dinosaur languages (with all the respect to the reptiles). --Kubanczyk 17:04, 19 October 2007 (UTC)[reply]

Aggregation in COM

This section may benefit from improvement, or possibly an image (see User talk:Rjgodoy/1). Shinobu (talk) 16:10, 7 January 2008 (UTC)[reply]

AggregationAndComposition.svg

Image talk:AggregationAndComposition.svg A user has requested that "Ducks" in AggregationAndComposition.svg be spelled "Duck" (singular). I think it makes sense, but I have no tools for editing svg. Rjgodoy (talk) 16:57, 20 February 2008 (UTC)[reply]

Car example

The example is questionable, especially the way in which it is phrased.

Essential to composition is that the part has a necessary link with a whole, but a wheel can exist separately from a car. The example should therefore make it clear that the wheel being regarded as part of a car is not so much a property of wheels and cars as it is a property of a possible model of cars. I don't think the independent functioning of cars and wheels has much relevance, what matters is how wheels are identified within the system. Agree? Rp (talk) 09:50, 30 March 2009 (UTC)[reply]