夏普架构替代方案
我正在寻找 Sharp Architecture 替代方案,它首先使用实体框架代码作为 ORM。有没有类似Sharp Architecture这样EF代码优先的成熟项目?
I am looking Sharp Architecture alternative which use Entity Framework code first as ORM. Is there any mature project like Sharp Architecture with EF code first ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
建筑是一个蓝图。一旦您看到 Sharp 架构,您应该能够简单地思考它并将其更改为与 EF 一起使用。如果您无法做到这一点,您可能对所需的 API 没有足够的技能 - 这是您在开始处理架构之前必须更改的第一件事。任何架构都无法帮助您理解 API,如果不理解它们,您就无法正确使用 API 的功能来构建良好的架构。
架构应该由应用程序的需求驱动。您想要改变应用程序的需求来满足某些架构蓝图的方法是非常错误的。首先,您必须定义您的架构应该为您解决什么问题,然后您可以询问是否有任何蓝图已经在这样做(仅此而已)。
大多数文章和示例架构只是在推动大量模式,而不是实际需要它们。模式和层的数量并不能构成一个好的架构。在大多数情况下,它只会使系统过度设计并且难以维护。这些示例主要用于解释如何实现某些模式。
Architecture is a blueprint. Once you see Sharp Architecture you should be able to simply think about it and change it to work with EF. If you are not able to do that you probably don't have enough skills with required APIs - that is th first thing you have to change before start dealing with architecture. No architecture will save you from understanding APIs and without understanding them you cannot do a good architecture correctly using features of your APIs.
Architecture should be driven by needs of your application. The approach where you want to bend needs of your application to fulfill some architecture blueprint is terrible wrong. First you have to define what should your architecture solve for you and after that you can ask if there is any blueprint already doing it (and nothing more).
Most of articles and sample architectures are just pushing a lot of patterns without actual need for them. Number of patterns and layers don't make a good architecture. In most cases it just makes the system overachitected and hard to maintain. These samples are mostly for explaining how to implement some patterns.
坏消息是没有确切的替代品,好消息是很容易像我一样创建自己的东西。
我已经使用 S#arp 很长时间了,它是一个很好的架构,我用它开发了很多应用程序,但看起来这个开源项目没有更多的进展,所以去年年底我决定继续重新创建类似的东西使用相同的原理但使用实体框架。
NHibernate、NHibernate.Validator 和 Castle Windsor 等关键组件分别被替换为使用 Entity Framework、LINQ to Entites、System.ComponentModel.DataAnnotations 和 Autofac。这些层保持相同,如域、表示、任务、框架和基础设施。
关于我如何创建它,请查看这篇文章的详细说明。
http://www.macaalay.com/2015/10/20/creating-a-solid-architectural-foundation-from-scratch-is-not-really-that-hard/
我还创建了一个代码生成器,我称之为 Effinator,它可以从您的代码生成 CRUD 操作和基本 UI数据库设计
Bad news there is no exact replacement, Good news its easy to create something your own like I did.
I have been using S#arp for a long time and it is a good Architecture, I developed lots of applications with it but it looks like there is no more movement with that open source project so late last year I decided to move on an recreate something similar using the same principles but with Entity Framework.
Key components such as NHibernate, NHibernate.Validator and Castle Windsor was replaced to use Entity Framework, LINQ to Entites, System.ComponentModel.DataAnnotations and Autofac respectively. The layers remained the same like the Domain, Presentation, Task, Framework and Infrastructure.
On how I created it please have a look at this post on its detailed explanation.
http://www.macaalay.com/2015/10/20/creating-a-solid-architectural-foundation-from-scratch-is-not-really-that-hard/
I also created a code generator which I called Effinator, which generated CRUD operations and basic UI from your database design