I have an UserDAO and an CountryDAO object.
When I insert an User object into database, first I must check if the Country for that user exists in database (if nobody deleted it).
If I check this in insertUser() method from UserDAO object, I must get a reference of CountryDAO object. This seems wrong to me, because I tight couple two DAO objects.
If I am doing this on a Service layer, using those 2 DAO objects as members in Service, It whould be esier to do this checking at this level, but is this business logic? Is not more Data integrity logic?
Best Regards,
Florin Marcus
|