Click here to Skip to main content
15,887,812 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionUML state diagrams Pin
Phil00510-May-11 7:39
Phil00510-May-11 7:39 
AnswerRe: UML state diagrams Pin
Gerben Jongerius10-May-11 21:19
Gerben Jongerius10-May-11 21:19 
GeneralRe: UML state diagrams Pin
Phil00515-May-11 1:22
Phil00515-May-11 1:22 
AnswerRe: UML state diagrams Pin
Keld Ølykke24-May-11 3:16
Keld Ølykke24-May-11 3:16 
GeneralRe: UML state diagrams Pin
Phil00527-May-11 1:04
Phil00527-May-11 1:04 
QuestionStored Procedures Pin
Leslie Sanford9-May-11 17:38
Leslie Sanford9-May-11 17:38 
AnswerRe: Stored Procedures Pin
Gerben Jongerius10-May-11 21:27
Gerben Jongerius10-May-11 21:27 
AnswerRe: Stored Procedures Pin
jschell24-May-11 8:43
jschell24-May-11 8:43 
Leslie Sanford wrote:
I was wondering what the best practises are for stored procedures. Basically,
I'm still struggling with a kind of code explosion that occurs when writing code
that's related to the database. In the end, what I need to do is move data into
and out of the database while sometimes performing transformations and doing
error checking along the way. I've found over and over again that it takes a lot
of code to do this.


Learn to use existing frameworks. Dynamic ones or generated static ones.

Database code is often something that is very amenable to those types of implementations.
Myself I have been write database layer code generators for years.

Additionally other common functionality is easily assigned into the same layer generation types. For example one can generate field generation code that validates such things a existence, length and even pattern for use in things such as GUI code.

Some of this is something that you are more likely to gain an advantage by learning to write your own code generators.

Leslie Sanford wrote:
I'm curious if stored procedures are a good way to abstract out of code such
things as queries, inserts, updates, etc., and move them into the database
itself.
 


Yes. For the same reason that one create any layer code - to abstract the user from the implementation.

Leslie Sanford wrote:
I'm finding that database programming is largely procedureal in nature, so I'm
not finding my experience with Object Oriented programming and patterns to be of
much use.


Relational databases have a very long and successful history. For a reason.

So avoid the inclination to even attempt to make it OO. There are in fact ways to do that and it is unlikely that it will lead to positive versus negative results.

You start with a data model. Then you use stored procs and the database layer to translate the relational model into an OO model. Just as you do with any other translational layer.

As a final note don't get to wrapped up in where the "best" place is for business logic. As an example don't avoid uniqueness keys in the database simply because that is expressed as a business rule. The database can implement that just as well, and probably better for standard business cases, versus attempting it in the database layer.
QuestionThinking about the Future Pin
John D. Sanders6-May-11 8:53
John D. Sanders6-May-11 8:53 
AnswerRe: Thinking about the Future Pin
Pete O'Hanlon6-May-11 9:26
mvePete O'Hanlon6-May-11 9:26 
GeneralRe: Thinking about the Future Pin
Sandeep Mewara6-May-11 17:41
mveSandeep Mewara6-May-11 17:41 
GeneralRe: Thinking about the Future Pin
Pete O'Hanlon6-May-11 22:39
mvePete O'Hanlon6-May-11 22:39 
GeneralRe: Thinking about the Future Pin
Paul Michalik14-May-11 22:56
Paul Michalik14-May-11 22:56 
GeneralRe: Thinking about the Future Pin
Pete O'Hanlon17-May-11 1:23
mvePete O'Hanlon17-May-11 1:23 
AnswerRe: Thinking about the Future Pin
RobCroll6-May-11 16:51
RobCroll6-May-11 16:51 
AnswerRe: Thinking about the Future Pin
Shameel9-May-11 2:33
professionalShameel9-May-11 2:33 
AnswerRe: Thinking about the Future Pin
weberrich31-May-11 5:55
weberrich31-May-11 5:55 
GeneralRe: Thinking about the Future Pin
John D. Sanders31-May-11 7:06
John D. Sanders31-May-11 7:06 
QuestionAbout Three -Tier and N-tier Architecture? Pin
maruthimaru29-Apr-11 22:58
maruthimaru29-Apr-11 22:58 
AnswerRe: About Three -Tier and N-tier Architecture? Pin
DaveAuld29-Apr-11 23:08
professionalDaveAuld29-Apr-11 23:08 
AnswerRe: About Three -Tier and N-tier Architecture? Pin
Sandeep Mewara30-Apr-11 0:22
mveSandeep Mewara30-Apr-11 0:22 
AnswerRe: About Three -Tier and N-tier Architecture? Pin
Legor5-May-11 3:35
Legor5-May-11 3:35 
QuestionMVC Implementation Question Pin
Roger Wright25-Apr-11 18:13
professionalRoger Wright25-Apr-11 18:13 
AnswerRe: MVC Implementation Question Pin
Legor5-May-11 3:29
Legor5-May-11 3:29 
QuestionPopulating Data Model Properties Pin
Kevin Marois25-Apr-11 5:36
professionalKevin Marois25-Apr-11 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.