-
Design Advice
hi
I am developing a system using vb & SQL - I was wondering how I should tackle the design stage - to simplify things:
a) would i be best using VB purely for the interface?
b) Use SQl to implement all business rules?
c) implement business rules using VB?
any help would be greatly appreciated!!
-
Is this a Client-Server system or will it be multi tier?
-
Thanks for replying....it will be a client /server system!!
-
I would think that some of your business rules can be implemented in the SQL Server layer by unique indices/Primary key and Foreign key Constraints. These are a robust way of keeping your database tidy and give no performance hit, so use them as much as you can.
You can also use triggers in the database layer, but these are somewhat subjective. They are reactive rather than proactive methods of keeping business rules (in that they will roll back any invalid database transactions rather than prevent them in the first place). As such they can use up resources, but judicious use gives you a very robust database. Any exceptions arising from the database level can be easily transferred back to the client (including transactions rolled back by triggers)
I fell that business rules that cannot be implemented in the database should be in your client in VB.
-
so lets see if I've got this right - youre saying, the best way is
to implement as many business rules into SQL and if that is not
possible place them into VB??
Thanks in advance for all your help
-
Pretty much. With the exception of triggers it is better to implement rules in SQL rather than elsewhere. It is much better to encapsulate your rules with your data. It comes in handy if you wanted to change/upgrade your front end while keeping your database.
It has the added advantage of making a lighter VB application which is quicker to install and start up.
-
Goatsucker., Thanks for all your advice...its very much
appreciated...