Reputation: 211
i have a question regarding the dynamic coposition of a GUI with respect to the data that this GUI should display. is there any kind of best practice or pattern how to dynamically build a GUI and still maintain a clean seperation of concerns / layering strategy?
here is my business case: i want do wirte a tool for creating a large number of random sharepoint list items i a sharepoint list. therefore i want to provide the tool the list URL. the tool will then query the list and provide a text box to enter a set of random values for every list column. since the colums vary from list to list, i cant buld a static UI / view. i have to build this view dynamically after getting the list information.
my current idea is to buld some kind of presentation logic, that reads the list metadata and then creates the textbox controls with respect to this metadata. this could happen in some kind of event handler.
thinking in the direction of MVC i dont got a static view which is (common) in MVC in my situation. would it be good design if the view examines the list metadata in its initialising routine, then builds the input controls (textboxes) dynamically and then binds / links them to the corresponding list columns?
Thanks for your feedback and best regards Patrick
Upvotes: 1
Views: 786
Reputation: 1977
Sounds very much like the Naked Objects approach:
http://en.wikipedia.org/wiki/Naked_objects
However, your data layer (including the database) would need to be very well designed i.e. would need to relate to the problem domain.
Upvotes: 1