原文地址:http://community.devexpress.com/blogs/eaf/archive/
接口和BOModel
This post is one in a series about our work on Domain Components (DC) framework and related component libraries. I’m just describing what we are working on, what problems we are facing and what results we've got so far.
这篇文章是系列博客之一,关于我们对DC框架工作情况,有关构件库。我只是描述了我们正在努力的工作,遇到的问题,以及目前的工作进展。
Now, while I’m waiting for the XPO team, who promised me to support new requirements, I've found one more problem. In my BOModel node, I can see the IDeveloper and INote interfaces, but I can't see the IPerson interface. Since our ultimate goal is to provide the ability to create reusable domain components, I want to be able to set up all XAF-related aspects of the IPerson in the Application Model, and then reuse these settings in all places where the IPerson is implemented.
现在,我正在等待XPO团队,谁答应给我以支持新的需求,我发现了一个问题。在我的BOModel节点,我能看到IDeveloper和INote接口,但不能看到Iperson接口。由于我们的终极目标是提供能建立可重用的领域构件,我希望能设置所有XAF相关IPerson方面在应用程序模型中,然后重用这些设置IPerson实现的任何地方。
But should I add all interfaces to the Application Model? What if the IDeveloper is inherited from the IDisposable, in addition to other interfaces? Should XAF add the IDisposable to the BOModel node? I guess not. There should be a way to mark the interfaces that are used for building entities later. I decided to add the DomainComponentAttribute that will serve as a mark:
但我应当添加所有接口给应用程序模型?假设Ideveloper继承自IDisposable,除了其他接口?应当添加Idisposable 到BOModel节点?我想不是。应当有种方法标识这个接口用来构建实体的更新版本。我决定添加DomainComponentAttribute作为标记:
[DomainComponent] |
public interface IPerson { |
string FirstName { get; set; } |
string MiddleName { get; set; } |
string LastName { get; set; } |
string FullName { get; } |
DateTime Birthday { get; set; } |
Gender Gender { get; set; } |
} |
Now, after I've refacored the code that analyses types inside XAF, the interfaces that use the DomainComponent attribute are added to the BOModel node:
现在,经过我refacored分析类型的代码,里面XAF,接口,使用DomainComponent属性添加到BOModel节点:
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/