Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:50:44+00:00 2026-06-03T21:50:44+00:00

first of all, sorry if the title is a bit confusing. i’m planning to

  • 0

first of all, sorry if the title is a bit confusing.

i’m planning to develop a small erp application. this apllication will use plugins/addons. this addon might add or extend some modules of the base application.

for example, i have TCustomer class with property “id”, and “name”.
addon 1 will add a property “dateofbirth”.
addon 2 will add a property “balance” and a method “GetBalance”.

addon 1 and addon 2 are not aware of each other. addon 1 might be installed and not addon 2 or vice versa. so both addons must inherit the base tcustomer class.

the problem is when both addon are installed. how do i get extended properties in both addons? i will also have to extend the form to add controls to show the new properties.

can it be done using delphi? what is the best way to achieve this? maybe you can point me to some articles of examples?

thanks and sorry for my poor english
Reynaldi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:50:46+00:00Added an answer on June 3, 2026 at 9:50 pm

    Well, as you are already aware, you can’t have more than one plug-in extend an existing class by inheritance. It would confuse the heck out of any app, including any programmer’s dealing with the code.

    What you need is some type of register mechanism in your TCustomer class where every plugin can register its specific properties, or provide a couple of call back functions for when a TCustomer instance is created (initialized), loaded, stored, or deleted. The core TCustomer after all really doesn’t need to know more about the plug-in’s than the fact that they might exist.

    Depending on how you intend to load/store your data, the core TCustomer class doesn’t even have to be aware of the extensions. It would be quite sufficient to make the persistence mechanism aware of plug-ins and provide a way for them to register a call back function to be called whenever a TCustomer / TOrder / TWhatever is initialized / loaded / saved / deleted.

    You will also have to make the GUI aware of the plugins and provide the means for them to register pieces of UI to have the main GUI create an extra tab or some such for each plug-in’s specific controls.

    Sorry no code example. Haven’t yet implemented this myself, though I thought about the design and it is on my list of things to play around with.

    That said, to give you an idea, the basic mechanism could look something like this:

    TBaseObject = class; // forward declaration
    
    // Class that each plug-in's extensions of core classes needs to inherit from.
    TExtension = class(TObject)
    public
      procedure Initialize(aInstance: TBaseObject);
      procedure Load(aInstance: TBaseObject);
      procedure Store(aInstance: TBaseObject);
      procedure Delete(aInstance: TBaseObject);
    end;
    
    // Base class for all domain classes
    TBaseObject = class(TObject)
    private
      MyExtensions: TList<TExtension>;
    public
      procedure RegisterExtension(const aExtension: TExtension);
      procedure Store;
    end;
    
    procedure TBaseObject.RegisterExtension(const aExtension: TExtension);
    begin
      MyExtensions.Add(aExtension);
    end;
    
    procedure TBaseObject.Store;
    var
      Extension: TExtension;
    begin
      // Normal store code for the core properties of a class.
      InternalStore; 
      // Give each extension the opportunity to store their specific properties.
      for Extension in MyExtensions do
        Extension.Store(Self);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first of all sorry for the title. I know this is not so clear
First of all, sorry for this topic title, I couldn't manage to find another
First of all sorry for the confusing thread title. I couldn't come up with
First of all, I'm sorry I can't figure out a better title for this
First of all sorry for the name of the title, but i dont know
First of all, sorry about that title. I'm not the best at writing those
Well, first of all sorry about this question it must be pretty straight forward
Maybe it's a similar beginning, but it's true. first of all sorry if this
First of all, sorry for my English... I'm developing an iOS application that has
First of all, sorry for my English. I need some help with this. Recently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.