Need help moving business rules from UI to BLL

Jun 30 2010 1:09 AM
Hi,

I have wrote a 3-tier app for college in .Net 3.5 and I want to use it to show a potential employer as soon as possible. I've realised at the end of it that my decision to do error checking of empty fields and date formats in the UI means that I have put business logic there instead of the BLL. At the moment by BLL is pretty useless as it just takes a DTO from the UI and passes it straight through to the DAL during the appropriate method call, and returns a DTO or List of them in most cases.

I have since read about CSLA.Net which looks good but I don't have time to do a re-write in that particular framework as it looks pretty complex to me. I am looking for the quickest way that results in a good way. I will paste what I have below. Any help very much appreciated!

UI - MainAttractionsView.cs
_________________________
if (ErrorCheckOk(attractionInfo))
{
     //some code
      HolidayPlanner.BLL.Attraction attractionBLL = new HolidayPlanner.BLL.Attraction();
      attractionBLL.AddAttraction(attractionInfo);
}


BLL - Attractions.cs
__________________________
 public void AddAttraction(AttractionInfo attractionInfo)
 {
            SQLServerDAL.Attraction attractionDAL = new SQLServerDAL.Attraction();
            attractionDAL.AddAttraction(attractionInfo);
 }


DAL - Attraction.cs
__________________________
 public void AddAttraction(AttractionInfo attractionInfo)
{
       //update DB
}



Note: My AttractionInfo object is just a DTO that has private fields, a constructor and public properties.

Many thanks for any advice.

Simon.


Answers (2)