0
的方法我们已经成功地完成开发新的Web应用程序。它有表示层,业务层&数据访问层。最佳中间层和转换功能
新的Web应用程序,我们移植现有的业务层&数据访问层只表示层将被改变。
尽管我们要使用相同的业务层,但会出现可能存在不同模型而非现有模型的情况。
我们计划建立中间层(新型号)和转换功能,从现有的业务层提供的模型产生新的模式。
namespace Busniess
{
public class Employee
{
public string FirstName {get; set;}
public string LastName {get; set;}
}
}
新的中间层,
namespace Intermediate
{
public class Employee
{
public string Address {get; set;}
public string Zip {get; set;}
}
}
当我创建员工的情况下,Employee对象应该能够转化成下面的场景
1. GetAll (all the properties FirstName, LastName, Address & Zip)
2. Selected (FirstName & Address) - if possible controlled through attribute decoration.
什么是创造最好的办法中间层&转换函数?
如果中间层&转换函数不是一个好候选,那么最好的方法是什么?
这是扩展现有模型类的基本继承。 – niksofteng