| Newsgroups |
gmane.comp.lib.binarycloud.devel |
| Organization |
Solutions Only |
| Message-ID |
<4220A954.9088.17BBDF4@localhost> |
Hi,
the bad: to me it seems you hit an inconsistency in the design of
simpleentity.
the good: there must be a way to serve this using conf or else.
Let's see first if I understand your problem, see below:
On 25 Feb 2005 at 12:15, Jean-Christophe Michel wrote:
> Hi,
>
> I'm faced to a conf pb that neither current nor new Conf design can solve.
> For the SimpleEntity vortex package, I need a place to store a map
> entity-base-class-name => path to class. What for?
First impression: conf could do that
Second impression: node has something like that, without conf
> For instance, I have in vortex/store an entity called Item.php.
> I want to extend it in my own app, but keep everything else from
> vortex/store. As the Item class is included and instanciated in many
> places, I cannot extend it without copying the whole vortex/store dir
> and modifying all files, simply to change the include_once line and set
> my extended class path.
So your application uses an item, that is already available in
vortex/store. Than, store/vortex uses simpleentity. Correct?
You want to extend the item_class of vortex/store.
> The solution I think to is this one:
> * have a map 'base class name' => path in conf
> * use include_entity(), defined in SimpleEntity
> that uses this map to load the right class.
Entities are defined from an .edf , right ?
> For instance for my item, with this in conf:
> item => app/myapp/MyItem.php
> include_entity('item') would include my extended class.
>
> The problem is that I need that different packages using SimpleEntity
> place their conf in the same path:
> vortex/store should have a conf SimpleEntity containing
> 'item' => vortex/store/entities/Item.php
> placed in simpleentity domain
> (conf path being simpleentity/class_path/item)
> and in my app I need to overide this value with
> 'item' => app/myapp/MyItemp.php
> with the same conf path :/
So there is a need to subclass 'item' from simpleentity, and to subclass
'item' for other apps. Isn't that a construction very like Node?
If simpleentity is in binarycloud_core in stead of in vortex, would that
solve the problem?
> Any solution ?
First Impression: the conf: should not be in SimpleEntity's conf path.
Second Impression: you shouldn't use conf but some definition file (like
node does).
Third impression: if include_entity('item') is a function, it would be
better to have include_entity('item', 'path_2_class').
Basicly, the suggestion is to have a conf_value with two different values.
Sortof quantum_value.
I think that would also be possible with conf in a slightly modified
environment. My initial conf_class allows for having a dynamic conf
object, without touching the singleton nature.
Please show some more on the nature of your problem. Let's work that out.
wim niemans