Interface and abstract entities - Mendix Forum

Interface and abstract entities

0

It would be very cool to be able to use interface and abstract entities in Mendix, just like in Java.

See https://docs.oracle.com/javase/tutorial/java/concepts/interface.html and https://docs.oracle.com/javase/tutorial/java/IandI/abstract.html

An example of how an interface entity could be used: In the (fake) screenshot below you see a Person interface-entity, which is implemented by the Employee and Customer entities. Employee uses the System.User entity as generalization, hence inherits the Name attribute. With both entities implementing the Person interface, you can use both of them as a Person. This could come in handy, for instance in the case you would like to create a overview page with all Persons (Employees and Customers) in a single list.

asked
1 answers

Isn't this just an example of a poor data model? That could be solved by linking accounts (inherits from system user) to employees and or customers.

And making a generalization entity called Person that both customer and employee would use.
I don't really see any benefits over generalization / one to one? Could you explain that?

The generalization Person could be passed to microflows and can receive Employee or Customer objects which then can be cast in order to trigger specific logic per specialization.

 

Created