Ok, so I'm still working on keeping my layers separate from each other. I am using the adapter model. In my BLL, I have a StudentManager class with a static method to return to me an instance of my own MyStudentEntity which I have inherited from the generated Entity class in my DAL. This custom entity has a few of my own properties that I want to add.
So, in MyStudentEntity class, I have the following references:
using HLPUSD.SMART.DAL;
using HLPUSD.SMART.DAL.EntityClasses;
using HLPUSD.SMART.DAL.FactoryClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
...which is just fine because my BLL should be able to see my DAL.
Now, in my PL, I want to create an instance of MyStudentEntity, so I do this:
MyStudentEntity se = StudentManager.GetStudentFromStuID("123456");
...which calls this static method in StudentManager:
public MyStudentEntity GetStudentFromStuID(string stuID)
{
DataAccessAdapter ad = new DataAccessAdapter
MyStudentEntity s = new MyStudentEntity(stuID);
ad.FetchEntity(s);
return s;
}
I suppose I should mention that in my PL, I have a reference to my BLL but NOT by DAL. The problem happens when I try to compile because I get a "Referenced Class 'HLPUSD.SMART.BLL.MyStudentEntity' has base class or Interface 'HLPUSD.SMART.DAL.EntityClasses.StudentEntity' defined in an assembly that is not referenced. You must add a reference to 'HLPUSD.SMART.DAL'"
When I add that reference and a reference to SD.LBLGen.Pro.ORMSupportClasses then my solution compiles. So, does that reference requirement mean that my PL somehow needs access to my DAL? What are the possible ramifications of adding this reference into my PL project? I presume it may not separate my tiers, but that is less important to me than actual functionality. I guess one area of possible concern is future use of remoting. Does this pose any foreseable problems if I reference my DAL inside of my PL project but do not use any code in my DAL specifically?
Oh, and sense I'm still learning, please suggest any improvements you may see. Thanks.
-Nick