#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2008
    Posts
    10
    Rep Power
    0

    Fully user configurable dynamic systems.


    Hi,

    I've been looking at some very clever software recently, and to satisfy my own curiosity I want to try and figure out how it works under the covers.

    It is essentially a CRM system but it allows the user to define their own business 'objects' via a configuration utility. To these objects you can obviously add properties and even associations to other 'objects'! It then has a complex UI designer so the users can layout how they want the object to be displayed on screen.

    How would you tackle such a problem?

    Firstly database schema.. Do you dynamically modify the database schema to actually add new tables whenever the user creates a new object? Or, do you have a fixed schema with one table that stores the data for all types of objects (presumably all data would have to be stored as a string representation in a single string-based column).

    Secondly, application level.. Do you dynamically build classes using reflection? Or, do you have some generic object that represents all dynamic objects (surely this would be a nightmare to program against).

    Are there any design patterns for dealing with this kind of scenario?

    Any insights you can provide will be very interesting.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    112
    Rep Power
    10
    Hi,

    There are two common ways you can design this solution:

    1) Some old applications used to create table schemas dynamically. I know this sounds weired, but they actually used to do it.

    2) Most new applications write their own interpreters. The design created by you is not stored as database schema but is stored as XML data. Custom interpreters then read this schema work on it.

    Now, you also have schemaless database systems. Soon we might also see solutions developed using these DBMS tools.

    Creating classes at runtime using reflection or dynamic compilation is not preferred in this sort of scenario. They are used in applications like creating mock classes in mocking frameworks.
    @ PresentSoft Technologies Pvt. Ltd., a software development firm in Goa - India, we develop scalable applications using on Ruby on Rails and Android.

    My blog @ AnayKamat.com
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    1) Some old applications used to create table schemas dynamically. I know this sounds weired, but they actually used to do it.

    2) Most new applications write their own interpreters. The design created by you is not stored as database schema but is stored as XML data. Custom interpreters then read this schema work on it.
    No application centered around data storage (like a CRM) is going to discard a database in favor of XML. XML is a terrible language for storing large amounts of data and an even worse one for processing large amounts of data.

    Modern applications that have extensive dynamic object definition systems (such as Drupal) modify the table schema dynamically and often use a generic object to represent all dynamic objects.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo