Not in direct reply to anything being said on this thread, but more of
a few suggestions.

In PHP4, the initialising method had the same name as the class ...

<?php
class Animal {
 // Constructor
 function Animal() {
 }
}
?>

In PHP5 the method is now __construct(), thought the PHP4 behaviour
persists through to PHP6.

The double underscore is PHP's way to signify a "magic" method. There
are many - __sleep, __wake, __toString, __call, __get, __set,
__destruct, etc.

The use of initialise / initialize for me is an issue purely from a
spelling perspective - both are acceptable spellings but only 1 would
actually be used. I would suggest 'construct' as the initialise
method. Also, would there be any mechanism for an AUTOMATIC destruct
mechanism? (An open Ajax connection should close when the user moves
off page or something like that - yes I know userland code can deal
with this via any number of mechanisms, but having it available as a
destruct method which is called automatically during the onunload
event would seem like a useful option).


Again, in PHP, to access the parent class you use parent::. There is
also self:: for static classes and $this to concrete instances.

In Delphi, there is 'inherited' which is used to call the overloaded
method of a parent class. But this is at the method level (i.e. using
the line ...

inherited;

in a method will call the same method in the parent class.



There is also the differentiation between parent and owner to be made clear.

Normally, parent refers to the class up the inheritance tree. Owner
refers to another class entirely which is responsible for this class
(e.g. an array object is the owner to any objects within its array
sort of thing). Calling an Owner method is just as useful. Owner may
also be thought of as a guardian.

In all my OOP work, every object instantiated for an application is
owned by something (the DB connection factory is owned by the
application instance, DB connections are owned by the factory, the
rendering engine - html/pdf/csv/etc are owned by a rendering factory
owned by the application). This allows for tidy shutdown at the end of
the app as any object "owning" another has to tell the owned object to
shutdown first. Every object can potentially own any other object.
Which is why I would like the automatic destruct method. You call the
obj_app.desctruct() method once and all objects are closed/freed in
the correct order (FILO), based upon the ownership structure.

For someone who comes to JS from Delphi and PHP in terms of OOP
coding, I am a little unsure on how to do what I want sometimes.
Having a clear way of doing inheritance (no matter what the way as
long as it is rock solid and consistent, no unnecessary short
circuits), then that would be a good thing.


To all of you working on this, thank you. I hope my suggestions are
treated fairly. Personally I would like things the PHP way as that's
what I know best and would save me the trouble of learning 2 ways, but
that's 'cause I'm lazy.

Good luck and thanks,

Richard Quadling.

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to