Re: Aggregation vs composition

From: Matthias Hofmann (hofmann_at_anvil-soft.com)
Date: 04/27/04


Date: Tue, 27 Apr 2004 18:28:03 +0200

Ilja Preuß <preuss@disy.net> schrieb in im Newsbeitrag:
c6luus$549$1@stu1id2.ip.tesion.net...
> Daniel T. wrote:
> > "Ilja Preuß" <preuss@disy.net> wrote:
> >
> >
> > Now I realize the above is only true in GC languages, in C++, A can
> > explicitly destroy a B object at any moment, the other clients of
> > that B object be damned. (Of course this applies to every client of
> > that B object.)
>
> Correct. In C++, it would be the responsibility of C to call the
destructor
> (or to give lifetime responsibility to someone else).

I guess you mean that A is responsible for calling the destructor, not C.

> > Second, A's ability to make such
> > imperious demands on objects that it doesn't have responsibility for
> > (namely other clients of B,) smacks of god class problems and IMO is
> > irresponsible.
>
> I don't follow you - what imperious demands are you talking about???

I think he means the imperious demand of requiring C to be able to cope with
the situation of B going up in smoke whenever A wants this to happen.

Regards,

Matthias



Relevant Pages

  • Re: SOT23 pin numbering
    ... my clients as well as the layouter's clients. ... If they re-enter the works then they can use any convention that they want but it is their responsibility to match your overall netlist. ... What a maintenance nightmare (should I call it an opportunity? ... So I understand your employer very well. ...
    (sci.electronics.cad)
  • Re: parser stack overflow, program too complex eroor C1026
    ... Or it's a compiler limitation or it's a compiler bug, ... > of 124 members any one ref class can be responsible for destroying ... > This is probably why pointers don't cause a problem: the responsibility ... I never ever create a class without a destructor. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Interesting legal question?
    ... It's actually like the .MYI file had been deleted, ... It still could mean that it was corrupt, ... Hosting companies tend to say "user's responsibility to take backups" ... different providers to host clients' web sites and don't back up FULLY. ...
    (uk.net.web.authoring)
  • Re: Aggregation vs composition
    ... >> have lifetime responsibility for its parts? ... A is responsible for controlling the lifetime, ... Yes, A, if it knows all of the clients of a particular B object, could ... request that all those clients drop their reference, ...
    (comp.object)
  • Re: STL Question: Safe to use elements after erasing them from the collection?
    ... > different containers, ... destructor to call) or a pointer or copied object or whatever. ... That's always the responsibility of whoever called new. ...
    (comp.lang.cpp)