Re: Where do business rules belong... OCP and SPs

From: Vladimir Levin (vladimir_levin_at_yahoo.ca)
Date: 01/19/04


Date: 19 Jan 2004 09:21:52 -0800

bentalcy@yahoo.com (Yaron Bental) wrote in message news:<93d90bd.0401182038.5d831d17@posting.google.com>...
> Hi
>
> Being an OO follower I believe, and I know a few other do too,

Maybe I am being too simplistic, but I really don't see what the
problem with using a stored procedure is. If it's an effective way
to get the results you want, then go ahead and use it. I would
suggest that your actual code should not access this stored
procedure directly; instead define an interface that delegates
its implementation to the procedure and make sure to access
that proc only through that interface. Say, in Java:

//customer domain object
public class Customer {
    public ComplicatedData getSomeComplicatedDataForCustomer() {
        //call stoerd proc to get complicated data
    }
}

For Java, I have worked on a team where we used dbunit with great results
to automate testing of this kind of functionality. In my opinion, one
should look for the most reasonable solution to a problem, not go out
of one's way to dogmatically follow what one thinks is the One True Path
out of a sense of religious fervor.

Vlad



Relevant Pages

  • Re: Darkroom software Help
    ... Apple's computer operating system OS-X includes the Java ... programing language, compiler, and integration software. ... have an Apple this fall. ... Said that, my system is based on a commercial lab interface, the ...
    (rec.photo.darkroom)
  • Re: A C++ Whishlist
    ... with the C++ string classes as compared with the Java ones. ... You can keep you structs entirely ... The simple separation of interface and implementation that header files ...
    (comp.lang.cpp)
  • Stuff the purple heart programmers cook up
    ... C To act like a framework for the JDBC driver developers. ... D To hide the specifics of accessing particular kinds of database ... Topic: Java 2: Survey Author: Chris Mc Devitt ... The JDBC ResultSet is actually an interface java.sql.ResultSet. ...
    (comp.lang.java.programmer)
  • Download Java / J2EE Interview questions
    ... JAVA Interview Questions ... What's an interface and how will you go about implementing an ... XML and Web Services ... Twist:- Explain in short all types of diagrams in UML? ...
    (comp.lang.java.programmer)
  • Download Java / J2EE Interview questions
    ... JAVA Interview Questions ... What's an interface and how will you go about implementing an ... XML and Web Services ... Twist:- Explain in short all types of diagrams in UML? ...
    (comp.lang.java.help)