ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <erlend.bjo...@aftenposten.no>
Subject SV: ParameterClass advice
Date Mon, 23 May 2005 14:30:02 GMT
Hi there!

I found out it was best to create a special paramter class if I 
need paramteres just for the queries. We have it like this:

public class SaleBean {
    Date saleDate;   // used for both queries and business logic
}

public class SaleParam {
    Date saleDate;   // could put this one here too, if needed
    Date frSaleDate; // only used for queries
    Date toSaleDate; // only used for queries
}

----

So if I can use the SaleBean alone, I use that one, but if I need extra query 
params, I use the SaleParam class. I also put them in two different packages !!

I think this is an issue of how you like to organize your code, if you don't
like to mix to much into your business objects, use two different classes, or
if you like 'less is best' use one class :-)


Works fine for us!


Regards,
Erlend Bjørge

Mime
View raw message