Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Ive learned at school that every databasetable should be an object in my model.</p> </blockquote> <p>So you did not learn object orientation? Inheritance? Mapping multiple object types to one table? Only the simple "stupid" every table is one object? There are more logical ways to map objects. All with their own different good and bad sides (i.e. you choose them depending on circumstances, among them the number of fields in each object).</p> <blockquote> <p>Also I've learned that for every table (or model object) there should be a DAO created into the DAL.</p> </blockquote> <p>Go to the school, demand the money back - they were idiots. Generated DAO's are bad to start with. Gets worse to have one per object. CONFIGURATION trumps CODE - a generic DAO can handle x different objects, depending on configuration. Lot less code to test and load. This is how proper frameworks do it (like Hibernate/NHibernate). You can esily write a DAL that has about half a dozen methods it exposes during operations and handles an unlimited number of objects. At start, you tell every DAL which object it has to handle and how, so it can generate the proper SQL etc.</p> <blockquote> <p>What is the best practice to handle this Bll 'problem'?</p> </blockquote> <p>Back to school, learning basics. Read up on O/R mappers. Hibernate / NHibernate (you dont name the langauge you use), Toplink etc.</p> <blockquote> <p>If a bll is in need of tablecontent from an other table where it aint responsible for, whats the best way to get the content? Go ask on the responsible BLL or go directly to the DAO?</p> </blockquote> <p>Depends on architecture. In general, a business object will come from a factory, and should only talk to the factory. The factory will then deal with the DAL - after and before doing the really interesting things like caching.</p> <p>Read up on Hibernate / NHibernate.</p> <p>A good book is also "Scott Ambler's" ancient "Building Object Applications that work".</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload