PDA

Click to See Complete Forum and Search --> : Data logic in Front End .NET app or Database?


VBCrazyCoder
Jun 6th, 2003, 04:19 PM
Whats the consensus on logic, or even formatting of data for an application. I am not talking about actual business rules, but the data itself. Should this be done in the app or should the app expect data that is ready to use?

This may not be a big deal, but I would like to get everyone here using a consistent way of doing it - and wanted some of your thoughts.

Thanks.

nswan
Jun 6th, 2003, 05:21 PM
i think formatting should be done by the front end.

hellswraith
Jun 8th, 2003, 07:43 PM
I agree, the more generic you leave your data access calls and your business logic, the more you can re-use them later. If you only return a dataset with the proper data that should be passed, then in your presentation layer format it to look like you want it. Now, if you ever need to reuse that business logic, you can expect a dataset it come back to your UI. That UI can then format it a different way than the first app, but still have the exact same result set to work with.

Lethal
Jun 13th, 2003, 08:25 AM
Also, you can create a seperate property(s) in the business tier, for example, FormatedBalance(), which will return you a formated version of the balance amount. However, I tend to keep all of my data formating done in the presentation tier, keeping the business layer as thin as possible.