hi mafi,

not the cleanest way, but for most people the easiest to understand! so, my hand for your solution. go ahead!

Am 06.01.2010 um 13:07 schrieb Mathias Fiedler:

Hello List,

I just wanted to bring up this topic from september once again to get some more opinions from you.

Allow modules for base classes would be one more killer feature of the eShop ...

please continue reading below.

Regards
Mathias


Am 03.09.2009 um 12:22 schrieb Mathias Fiedler:

Hi Sven,

I agree my solution might not be the best, that's why I brought it here to the list....

The advantage of the solution with the classes created at runtime is that like in normal OXID modules you can have multiple modules for the same base class.

About performance: I know that many levels of inheritance doesn't have a big impact on php performance. I don't know if the "eval" of the virtual classes is slow. But here you could think about a system of "caching" these virtual clases by physically writing these classes to the file system and only delete/rewrite them when installing new modules ....

Mafi

Am 03.09.2009 um 12:08 schrieb Sven Tietje:

hi mafi,

i think, thats quite dirty. why work with virtual classes? doing dynamic
stuff with classes is not good concerning performance.

even not cleaner, but i think for performance and code folding in IDEs skeleton classes will be the easiest way to implement that feature. oxid just needs to create an empty class, which can be filled with methods and
functions by the user.

first step - model:

class oxarticle extends my_oxi18n ...

my_oxi18n extends oxi18n ...

oxi18n extends my_oxbase ...

my_oxbase extends oxbase ...

second step - create files / skelecton:

create file: core/my_oxbase.php
class my_oxbase extends oxbase {
        // my methods
}

not cleaner, but easy and fast to implement for your developers and easy to understand for all developers out there: just open my_oxbase and do my
stuff...

sven

Mathias Fiedler wrote:
Hello List,

the following is keeping my mind busy for already quite a while....

Right now we can only extend "child" classes in OXID eShop modules
system. So only classes like "oxarticle" or "oxuser", but there is no
way to extend "oxbase".

But wouldn't it be possible to extend the framework in a way to allow
modules for base classes as well ?!


My idea:

class oxarticle extends oxi18n_base

whereas "oxi18n_base" does not exist as a file, but is created at
runtime to connect oxarticle to original oxi18n class. But if we want
to write a module for "oxi18n" we can do it ...

class myoxi18nmodule extends myoxi18nmodule_parent

hierarchy:

oxi18n (real class)

myoxi18nmodule_parent extends oxi18n ("virtual class")

myoxi18nmodule extends myoxi18nmodule_parent (real class)

oxi18n_base extends myoxi18nmodule ("virtual class")

oxarticle extends oxi18n_base (real class)

Could this work ?
Is it usefully?
Is there a need for such a feature?


Greetings
Mafi





_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to