Question

I'm building an web application to manage instructions based on different parameters (eg. JobCode, State, Customer, Product etc..). I have allocated some 20 filler fields for each of such parameters. The display names of the fields may differ from One Project to another. (multiple implementation).

Some project may not use all the 20 fields but only say 5-6 fields...

Now, one of my colleague is suggesting me to customise the stored procedure to return and accept the fields with column names required by the project, and let the SP do the lookup with actual column names. He also suggests to build controls dynamically.

I thought of providing static controls to all the 20 fields and just populate the labels with the necessary field names and interact with SP using field names "Filler1", "Filler2". This also means we need to make the non-required control invisible...

As more experienced users... Can you enumerate the pros and cons in both...

Thanks

Was it helpful?

Solution

For the end user it is going to be quite hard to understand the interface if the fields that are not applicable for a particular case are still visible.

So I would indeed advise not to generate any fields you don't need, or at the very least hide them in case they are not needed.

As for where to put the logic...well it does make sense to pull the data that determines what fields should be shown when from the database. But I would recommend against putting all the logic that actually renders the page inside a stored procedure. Rather, you would use the SP to fetch the data, and use your language (PHP, C#/ASP.NET, Java Servlet, what haveyou) to actually process the data and render the page.

htht.

OTHER TIPS

Its never good practice to use a set number of fields as you are describing (its better to build it dynamically - but make sure you write efficient code). By creating a set number of controls, you are limiting yourself, and creating a big maintenance problem. You may not see it now, but later, what happens if the number of controls changes?

Your colleague's suggestion would work. At least you'll have the ability to change the number of controls at any time without recompiling your code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top