Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Christian Schneider
Hendy Irawan wrote: database because the metadata is already built-in. Just a rough sketch: [columnType: "VARCHAR", size: 20] public $name; [columnType: "DATE"] public $birthDate; We do exactly this in PHP 4 already. The base class gets the meta-data from the DB and stores it in $this->_fields. No

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Duncan McIntyre
Wez, >(I added internals back in to the Cc:; presumably you missed that out >by accident in your reply) Thanks. Can you delete my email address from list as well please? :-) Grr. stupid me. Hello spam bots. I noticed I'd missed the list off cc, so I posted an edited version, which I guess you'

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Hendy Irawan
On 4/18/05, Wez Furlong <[EMAIL PROTECTED]> wrote: > Can you demonstrate some other practical use for attributes in PHP? > (please post an example to the list, even if it's psuedo-code--we're > mostly too busy to go off and read about something new until we've > been persuaded it's worth doing ;-)

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Wez Furlong
(I added internals back in to the Cc:; presumably you missed that out by accident in your reply) > Interfaces don't really provide this sort of functionality - take a look at > c#, > java or ruby to see > better examples than mine of how attributes are used Telling me to go and look at another l

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Duncan McIntyre
>PHP has interfaces for this kind of thing, and they're clearer/cleaner >to use than the code you've posted (for this case at least). Interfaces don't really provide this sort of functionality - take a look at c#, java or ruby to see better examples than mine of how attributes are used. I suppos

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Derick Rethans
On Mon, 18 Apr 2005, George Schlossnagle wrote: > > On Apr 18, 2005, at 8:26 AM, Wez Furlong wrote: > > > >From a technical viewpoint, how do these attributes affect the class? > > Are they simply no-ops that are tagged and made available via the > > reflection API? How does this really help imp

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread George Schlossnagle
On Apr 18, 2005, at 8:26 AM, Wez Furlong wrote: From a technical viewpoint, how do these attributes affect the class? Are they simply no-ops that are tagged and made available via the reflection API? How does this really help improve PHP? I know it sounds cool, but so does recording phpdoc commen

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Hendy Irawan
On 4/18/05, Wez Furlong <[EMAIL PROTECTED]> wrote: > PHP has interfaces for this kind of thing, and they're clearer/cleaner > to use than the code you've posted (for this case at least). Yea, I completely agree. > I'm not against the idea per-se, I just can't see a really good reason > to justify

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Hendy Irawan
> I am playing around with an extension to the Zend Engine 2 to allow class > properties and methods to be tagged with attributes. These attributes would > then be accessible through the Reflection classes: Sorry guys to just jump in, but Duncan's idea is an EXCELLENT idea IMHO... :-) Let's go be

Re: [PHP-DEV] Attributes support proposal

2005-04-18 Thread Wez Furlong
PHP has interfaces for this kind of thing, and they're clearer/cleaner to use than the code you've posted (for this case at least). It's also worth noting that the rendering of serialized data for an object is usually better handled by the class of that object, not its container. It is fine, of c