Entity Inheritance

Entity Inheritance

Hi, I am new to outsystems and would like to use it to build a replacement to a custom in-house legacy system and I would like to know how/if the idea of entity inheritance is supported.
In our current system, we have have a people object and then we have employee, contractor, vendor, student and instructor as different objects, each inheriting from person.
Person has a core set of attributes and each obect that inherits from it adds its own set of custom ones along with forms. How would we implement such a setup with outsystems?
This is typical database normalization.  Each of the entities that 'extends' the Person entity adds a foreign key, which is a field in the table that has the Person Identifier of the record in the Person entity that it is extending.  You must have something linkage like this in the current legacy system.

The challenge is doing the data conversion.  You would create the Person records by importing that data (several ways to do that) and then, using whatever currently links the employee, etc. set the foreign keys to the proper Person record. 

As for forms, once the entities are created you can create web screens (forms) in a few seconds with Outsystems.

Hope this helps,
Thanks for the response Curt, We view this a inheritance rather than normalization, but I can see how it can be viewed that way. If the system doesn't work that way, we can look for ways to work around it. One paradigm of the inheritance model was that we could define a relationship (e.g. one-many) between person and something else like a note and then have this available to other objects like employee, contractor...etc. if we go the above route, will we have to redefine relationships for each object?
You shouldn't have to define anything like that.  Create a Note entity with a foreign key to Person (just like all the other entities) and then when you want to show an Employee with their Note, just do a join Employee (Person foreign key) --> Note (Person foreign key).  If you want to show stuff from the Person entity also, add that to the join like Employee (Person foreign key) --> Person (primary key) --> Note (Person foreign key).  Very simple and flexible.

Good luck!
Hi Andrew,

The art of DB design seems to have died out. What you describe is not normalised..what happens if you want to capture another "type" of person

A note is a bad idea in terms of DB design as the data will be just text..unstructured..how to query it..how do you understand and mine text, best to model in a relational database.

I think you need to look at modeling the data first at the DB level first. Which is not an Outsystems question but just a question of DB design.

I would model the the entites as you descibed as a very rough begining:

Entity inheritance is not supported, the IS A relationship does not exist in Outsystems, it is not an OO approach. Please see http://www.outsystems.com/forums/discussion/16691/inheritence

Welcome to Outsystems

Thaks for the reply and diagram george,
The intent of Notes wasnt to track anything, it was just for illistrative purposes where one could collect a number of related text journals regarding a specific person.

The tracking of entity types isnt the issue, thats pretty simple, it is tracking and maintaing the various attributes that are custom to each. Each person type has 5-15 attributes that are not used by any other person type and I am looking for a way to represent that in OutSystems. That being said, looks like we may go with your option 2.

I take it we can build form elements that can cupture and display the custome attributes as we change types?
Hi Andrew,

I am a new to Outsystems but what I do know the forms are lighting quick to deliver and maintain.

The database modelling like in all software development is the bedrock of your application and it depends on your requirements, whether it is best to use Outsystems data modelling capabilities and limitations are dependent on your requirements.

For example is temporal data your requirement then to my knowledge Outsystems does not support temporal databases in the modelling but if for example in the IBM DB2 for i you could create temporal files and access these files by Outystems. Or handle historic data with historic files or dates etc in Outsystem defined files/entities.

There is the whole datacentric vs programcentric issue and my feeling is Outsystems is more program centric so if you want to program datacentrically pushing the logic as far down into the database using constraints, stored procedures, triggers etc I think it would be best to model the database outside of outsystems and integrate.

Are the person types infact static then model the relationships as extension files as Curt outlines, if you are likely to create new types then use an association relationship. How do you want to enforce these relationships..using extension files you have to programmatically enforce rules where as using the association relationship you can enforce relationships datacentrically 

None of this is a criticism of Outsystems and again I am new to the platform but not to software development and have always thought get DB right and all follows suit afterwards and with Outsystems that means supper quick and easy.

If you are an ISV then my gut feeling is you would want to future proof somewhat and use temporal data , use datacentric principles, record based security etc and therefore model for your chosen DB outside of Outsystems. But i have no experience on this assumption in terms of Outsystems.

If you are creating an inhouse application and the legacy system needs to be replaced yesterday and you are allowed to cobble together a few tables to hold your person data then model the DB with extension files in outsystems.

Since you talk about person...think about how you are going to model addresses! CRM is a huge topic and it starts at the database.