I want to create a GUI application (MVC asp web application) to create business rules that can be used for my business rules engine.
For this I have several objects (Request Objects) with various variables that can be used to create these rules. Because these request objects are also used in the validation of these rules.
An example, I have a TripRequest Object with a string variable 'Airline' and an int variable 'Price'.
I want in my GUI that when you select 'TripRequest' from a dropdown menu from various request objects. That a second dropdown menu is filled with all its fields (airline, price, etc).
Then when you select one of these fields, it needs to read its type (string, int) so that the GUI can give the appropriate operations (equals, not equals, larger, smaller than, etc) for the business rules.
My idea so far for creating such a GUI is to use reflection to read out all the field and method names from the various objects and use them to fill the GUI. Is this a good practice to use reflection?
I haven't used reflection before so I am wondering if there might be a better way to do it. I don't want to hard-code everything in because the application needs to be extend-able (new Request objects, new fields added to objects) without having to add more code to the GUI aswell.
my question: -Is reflection a good practice to use for this problem? -If not, what would you recommend using or looking at?
This is my first question on stackoverflow, if I did anything wrong please let me know so I can edit or change it.
Thank you for reading :).