Jean-Marc Orliaguet wrote:

> Tarek Ziadé wrote:
>
>>
>>> Tarek,
>>>
>>> you only need to use a class if you want to pass some arguments to the
>>> constructor otherwise use a literal object like
>>> var CPSMystuff = {...}
>>>
>>> Besides, your pattern creates memory leaks!, if you instanciate a new
>>> object or a class just to simulate a namespace, your browser will run
>>> out of memory sooner or later.
>>>   
>>
>>
>> ?
>>
>
> Your pattern of creating namespaces using classes creates memory
> leaks, I'll post a demo, so you can see for yourself.. 

you are still mixing concepts here, i am not creating namespaces by
creating classes, i am creating code organized
in classes and use it in my UI. classes organizations reveals therefore
a namespace when it's used.

This is getting weird, you are going to work on a demo to prove that
this is wrong, over something
that has not be written yet, but 3 lines in a mail + what you thaught
you understood.

wait when the guideline will be written,
at least when some of it will be, so we are talking on something
concrete we all understand and see.

>> [cut]
>>
>> why do you want to put that in a loop ?
>> sorry i don't get that point, put a loop over any instanciation and
>> it consumes memory, yes.
>
>
> The browser's garbage collector is called when the page is closed or
> reloaded. So as long as you run the application on a same page, it is
> as if you
> were inside a loop. Putting the code inside a loop helps you identify
> memory leaks as the ones you have just created.
>
Yes, but i still don't understand why you want to create more than one
instance here... and why you want to prove that creating a class instance
is a memory leak... there's no crazy loop anywhere but in your mind here ;)

[cut]

>>
>
> what about the memory leaks?
>
:(

again, why are you insisting so much ?
they are no memory leaks anywhere, but in the demo you want to make i think.

Maybe you are talking of memory leaks over the current CPS code ?  If
so, please do the demo, it's interesting.

if its for the incoming structure, you should wait the guideline on this
part, then make your demonstration over it  i think
 

Tarek


_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to