Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-09-2005, 08:07 AM   #1 (permalink)
deepak_kr_mehta
Guest
 
Posts: n/a
some question(ambiguious)

hello sir
sir i have some ambiguious matter which u can solve
is container class is local classes
and is aggregation and composition is same term?
from
deepak kr.
  Reply With Quote
Old 05-09-2005, 12:55 PM   #2 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
For question 1:
A container class can be implemented as a local class. But a local class is not persé a container and vice versa.
Local classes are usually use to protect an entire class or struct within the private section of the containing class. This may cause some problems when forward declaration is needed.

For question 2:
Coding wise they can be the same. Relation/design wise too.
However, design wise composition is usually meant to define datastructures.
Aggregation may holds the same relationship design wise, but its intent is for combining classes to define its requirements.

During composition (containers), if the holding class cease to exist, the contained of class-instance cease to exist as well.
__________________
Valmont is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 04:01 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting