Hello all!

We are building a high-level application with a lot of complex
technologies (xml, xslt, ...) and our challenges are to integrate this
in an ever changing world of other tools. If we should bother for every
Megabyte and every MHz needed by our users to run our tool, we are for
ever lost in details.

Please choose the most portable, most flexible, most well-documented,
and most correct solution without bothering about such details. Let the
compiler, jvm, hardware and OS-providers do their part of the work!

        /Linus


PS.
To get an estimate of how much impact this has you can make the
following calculations (for an ideal but jvm).

In A:
The class A has probably some kind of pointer to the Observer interface.
Overhead:
        size of class grows one pointer.

In B:
The anonymous class is an Object, each object has a semaphore.
The anonymous class belongs to the class B so it has a pointer to B.
The anonymous class is created for each call to someFunction() (this is
what Markus is focusing on) and eventually Garbed.
Overhead:
        class created for each call of someFunction()
        the size of the class is Object + one pointer.
        class eventually Garbed.



> -----Original Message-----
> From: Markus Klink [mailto:[EMAIL PROTECTED]
> Sent: den 1 september 2006 13:25
> To: [email protected]
> Subject: Re: [argouml-dev] Does using an anonymous object cause
overhead?
> 
> Yes, there is in a way some overhead, since obviously in version B the
> anonymous object is created again and again compared to version A
where
> an object of type A already exists. How substantial this overhead is,
> depends on many factors, e.g.  how often this code is called  or how
> much information is contained (internally) in an observer.
> 
> Markus
> 
> 
> Michiel van der Wulp wrote:
> > Hi All,
> >
> > Is there any overhead in using class B instead of class A?
> > And if so, how substantial is it?
> >
> > This could influence the architecture of the Notation
architecture...
> >
> >
> > class A implements Observer{
> >     public someFunction(){
> >         callSomeFunction(this);
> >     }
> >
> >     public void update(Observable o, Object arg) {
> >         doSomething();
> >     }
> > }
> >
> >
> > class B {
> >     public someFunction(){
> >         callSomeFunction(new Observer() {
> >             public void update(Observable o, Object arg) {
> >                 doSomething();
> >             }
> >         });
> >     }
> > }
> >
> >
> >
> > Regards,
> > Michiel
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to