Consider a multi-level application in which the DataLayer has a certain class with all data access materials in it and above, that the business layer has a class that can accept a data object in the constructor, and also has other overloads. Example:
namespace Datalayer
{
public class dataObject
{
}
}
namespace BusinessLayer
{
public class busObject
{
busObject(){}
busObject(Datalayer.dataObject parm) {}
busObject(int objectID) {}
}
}
The layers above (possibly the user interface layer) should not have a datalayer reference in this model. However, when creating ctors in a business layer, this is necessary. Can someone explain why?
I would prefer my ctors this way, but I don't want the datalayer link in the user interface layer. To get around this for today, I removed the last ctor and added a method per se to configure the object after instantiation:
Select(int objectID) {}
- , , ?
user202768