Replicating class functions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aktar
    New Member
    • Jul 2006
    • 105

    Replicating class functions

    Hi guys,

    I would like to create a class that "assimilate s" functions from other classes and uses these function as if were defined within itself.

    The objective of this little excersise is that I would be able to "extend" multiple classes and would be able to call functions from a single object.

    Anyone have any ideas?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    sounds to me like a Facade Pattern, although from my understanding, you need the logic of which method/class to choose anyway (in that aggregator class or in the script), so I wouldn’t use such a class. and btw. if you don’t have a really good error handler, debugging might turn into a nightmare.

    Comment

    • aktar
      New Member
      • Jul 2006
      • 105

      #3
      Funny you should mention debugging, because the idea was to introduce a facade pattern for better debugging from the built-in debugger.
      The current workaround I have is a bit messy and doesnt do this debugger too many favours.

      I've done some research and it seems the only clean way of doing this is to do a chain extend (a extends b, c extends b etc).
      But this approach seems very ineffictive as I would also like to reduce processing overheads by loading only the required functions at runtime.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        do you do autoloading?

        Comment

        Working...