Let say I have two components: TThirdPartComponent TDataAwareThirdPartComponent. The second is inherited from the first.

Let say I have two components: TThirdPartComponent TDataAwareThirdPartComponent. The second is inherited from the first.
I create a new component from TThirdPartComponent, add functionalities and so far so good.
Now, I want these functionalities to be reflected in the descendents of TDataAwareThirdPartComponent too but.

Which is the best way to achieve that ?

Comments

  1. Depends on added functionality. Sometimes using class helper for base class is enough

    ReplyDelete
  2. What if the functionalities I implement in TThirdPartComponent involve changing existing methods (that's why I inherit the new component from TThirdPartComponent in first place) ? AFIK class helpers cannot help here

    ReplyDelete
  3. I think that's why FMX use LiveBindings, so you can bind non DBAware components to a DataSource.

    Perhaps with Generic

    type
      TMyCustomThrirdPartComponent = class()
      end;

      TMyThridPartComponent = TMyCustomThirdPartComponent;

      TMyDBThridPartComponent = TMyCustomThirdPartComponent;


    there will be 2 classes but only one code.

    ReplyDelete

Post a Comment