this is bad practice imho, since it would lead to a bidirectional dependency 
from ezcBase on the components that require a registry since typehints and 
interface checks have to be implemented in the ezcBase Registry then, although 
supposedly all components have a dependency on ezcBase and not the other way 
round.

On Tuesday 14 April 2009 10:20:45 Thomas Koch wrote:
> Hi,
>
> I opened an issue[1] that ezcSearch misses lazy initialization and as a
> first attempt to solve it, I copied ezcPersistentSessionInstance and
> addapted it as ezcSearchInstance.
> But ezcPersistentSessionInstance has itself been copied from
> ezcDatabaseInstance. And I need another xyzInstance for a private component
> of mine. And surely there'll be more things to store and retrieve instances
> for.
>
> My first thought was to write an abstract ezcBaseInstance that would be
> extended by ezc[PersistentSession|Database|Search|Whatever]Instance, but
> unfortunately this doesn't really help since we miss late static binding.
>
> So my proposoal would be to provide a registry class in ezcBase that's much
> the same as the current classes, but takes an additional $type parameter
> for every method. Please see the attached code for an example.
>
> The current Instance classes would be left as is, but deprecated in favor
> of the registry.
>
> Best regards, Thomas
>
> [1] http://issues.ez.no/IssueView.php?Id=14633

-- 
Benjamin Eberlei
http://www.beberlei.de
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to