In my project, there is a need to add regional specific fields in whichever entity required. These fields will be visible when the project is run in the particular region. I guess this could be done either by using profiles in
pom.xml OR by using
For example :
Employee has name, salary, age. There would be an additional field '
regionalAge' which would hold age in terms of
Considering that we enter these details manually on a
jsp, I want to show the regional specific fields only when required.
I want to implement this by using
Aspect Oriented Programming. The current implementation is not very developer-friendly. Any suggestions?
P.S. I am new to
AOP and hope to learn the same via this example.
Q) How has this been presently implemented?
A) A new entity has been created say : RegionalData. This entity has a limited number of fields which are numbered like regionalField1, 2 and so on. This entity needs to be embedded into whichever entity that requires regional specific fields inside of it. Persisting the same has been handled.
There is an xml file say : regionalSpecificMapping.xml in which the 'jspName' in which I wish to use it in and the 'source entity name' are mapped.
There also is a regional mapping table that does the same and maps name of the field to source entity name and to the regional Field number #1/2/3.
This results in creation a limited number of columns that are created in the table of the entity in which we embedded the RegionalData. In these columns, regional specific values are stored.
I am looking for another approach as the current one will at some point fail to include more fields and would have to include more fields again.