I have a problem with duplicating things and databases make it worse

Submitted by metaperl on Mon, 04/11/2005 - 7:46am.

I do my best to avoid putting the same logic in two places in an application. However, my stored procedurees will require computations to be in other stored procedures.

Should my programming language access all of it's business logic from database stored procedures? But then I lose the power of a full-fledged programming language and must do everything in a kludgy pascal-like language.

I suppose the solution is to have the business logic/calculation in both places. Perhaps the program logic could generate the stored procedure logic???

Submitted by Derek Elkins (not verified) on Mon, 04/11/2005 - 10:14am.

Yes, if no one has to read the stored procedures (or you're willing to put out a bit more effort to make the output readable) then you could make a generator/"compiler" from some nice (possibly embedded) DSL (or whatever) to the stored procedure logic language.

Then you could write the logic only once and in a nice language.

This presumes you do want to have (some of) your business logic in stored procedures. Whether you do or not depends on your circumstances.

Submitted by shapr on Fri, 04/15/2005 - 12:02pm.

Once HaskellDB has backend specific code generation, stored procedures will likely be the best approach for speed and efficiency. That would give you everything you need.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.