The Artima Developer Community
Sponsored Link

Design Forum
Web application design pattern using only stored procedures ,NO Dynamic SQL

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Catalin Marin

Posts: 1
Nickname: dinojazz
Registered: Nov, 2009

Web application design pattern using only stored procedures ,NO Dynamic SQL Posted: Nov 11, 2009 6:55 AM
Reply to this message Reply
Advertisement
I've met the case where the customer says he wants no sql written in code,only stored procedures and ALSO NO objects in stored procedures. Is there a current design pattern that could meet this case particularly.

I was thinking: ok, so no queries in software only stored procedures calls.
I say like this, if I call stored procedures I actually pass the model part right into the database, and my DAO interfaces call directly those procedures, loading data into complex objects witch are more than just mirroring db tables, they can call and hold data for my BusinessObject, for example an invoice, an invoice has a customer with witch I have a contract and a list of products.Customers have their table,invoices and contracts also and they are all related.
I make a stored procedure that returns an invoice depending on invoice primary key value, this procedures also returns the customer , the contract and another procedure that returns the list of products. I have the Invoice object in my application and when I call a method, let's say
Invoice iv = new Invoice(34343); then my parametrized Invoice constructor dose somthing like this : HashMap data = DaoInvoice.getBasicInfo(); (calling my first procedure)
then I say this.setCustomer(data.get("customer")) etc..
The thing is that I want to stick to MVC as much as possible.

In short, creating wrappers for the models witch are no longer mine to control, as they belong to the guys that develop the stored procs.

Topic: N97 BAD Software Design Previous Topic   Next Topic Topic: What is prototype design pattern?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use