I like the way NCommon saves me from dealing with all the plumbing required to do DDD with NHibernate.
I like it so much that it I am seriously considering it to be part of my default architecture in new projects.
I'd like to ask if there are other DDD alternatives (aside from coding from scratch) to what NCommon does.
Thanks.
I haven't used it myself in production, just skimmed the source code, but there's an overlap with S#arp Architecture. In addition to the NHibernate basics, you also get ASP.NET MVC basics, since the goal is "building maintainable web applications".
Related
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 ?
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.
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
I am exploring technologies and libraries before I get started on a new project. One that has really caught my eye is the S#arp Architecture library for ASP.net MVC. However, I have already decide that the bulk of my web application will use Visual Web GUI as the front end, leaving only a small separate customer facing web component that will be developed in ASP.net MVC. Bearing this in mind, based on the experiences of those of you who have a good familiarity with S#harp Architecture, or may have attempted a similar solution using S#harp, are there any issues or gotchas I should be aware of before I begin? I have also had a look at Castle Active Record, and Fluent NHibernate usage as possible options, but find myself leaning towards S#arp.
My most major goal in choosing a library are to get my data access set up using the repository pattern as quickly as possible.
If your main goal is to flesh out a persistence layer quickly then S#arp Architecture is a bit overload IMO. S#arp makes use of Fluent NHibernate so I'd just go with that. FNH's auto mapping conventions should slice a big chunk off your dev time.
I wouldn't say S#arp is a library. It's more of a boilerplate for Domain Driven Design. You should be familiar with Dependency Injection (aka Inversion of Control), Test Driven Development, Rhino Mocks, and NHibernate before you start looking at S#arp (because those are the concepts and technologies used in it). Otherwise the learning curve will be quite steep.
We have implemented a ASP.NET standard project using the S#harp framework without any problems. I would strongly recommend you start coding from the Services layer and leave no logic in your codebehind aspx files. We do also make big efforts to avoid having logic in Controllers as we saw them as codebehinds files and try to put all the system logic in the services.
Just make sure you plug all necesarry in your global asax file and you should have no problem at all. If you are using NHibernate, Fluent, Service Injection and DDD is really easy to make it work with old asp.net web application.
I'm going to have to write a big system in January with ASP.NET MVC3 / C#, and need to know how to write a system that will WORK. I do have a bit of experience with ASP.NET MVC and C# but would not call myself an expert. It needs to be extensible so that I can extend it later with new features. How would one go about this? Is there books that explains this topic in detail or should I use trial and error?
In short I need to know good design practice in my code thats extend-able for the future.
Regards
RaVen
The System will be a community portal with forums ratings etc. Cant say more than that << Company Policy>>, The forums I can manage because of plenty open source options... But the rest is up to me.
SOLID == Great Success
Follow SOLID principles in any project and you'll do well.
With regards to core infrastructure/architechure, SharpArchitecture is a good place to start. It is by no means the perfect solution...BUT they give you a good framework to play with and you can have a working system quickly while learning the concepts that work and don't work over time. Take a look and see what you think. It uses NHibernate, Castle and MVC.
Test Driven development will ensure quality for your project. Be strict with yourself, red green refractor. One of MVCs strengths is that it's easier to test.
Professional ASP.NET MVC 2 is a good starting point, though, I would assume that they'll come out with an MVC 3 edition as well. The NerdDinner tutorial contains a lot of ideas on how to structure your application.
Basic advice: work with the MVC architecture, not against it. Understand your application, especially your data model, and layer that onto your application structure. Typically you'll have a controller per model, but not always.
If you want more detailed advice, you'll need to be more specific about your project. I'd suggest coming up with specific questions about various details of your design as you have them, rather than a single question covering the whole project. The latter probably won't get the kind of response you desire.
you can use my "awesome" demo as a start
http://awesome.codeplex.com
If it's going to have to be extensible, make sure you write tests. You'll save yourself sleepless nights in the long run when you fix something, but ended up breaking the entire system.
As far as how to make things "WORK" - that depends on your ability. Read, and look to improve things, but don't get caught in premature optimization or it will leave you dead in the water.
Based upon your edit and your abilities, it might be wiser to select an open source CMS written in ASP.NET MVC and support it. Your skills are good enough, it sounds like, to learn how to write modules and be part of a larger community. You do not sound like you really want to write the whole thing because you are timid about your skills, deadlines, etc. Whilst learning the ins and outs of a well written piece of software, one day you may choose to write your own or contribute to a core piece of the software. There are several to choose from see my comment above under your question.
edit: I also think this will allow you to just start and not worry about every design paradigm people will throw at you for success.
WhoCanHelpMe is a nice reference application. It's built upon S#arp Architecture which is a good starting point for an MVC-application using domain driven design. That will also help you on the way with wiring IoC and db-stuff.
Remember that not every example and framework will fit your requirements, so do as jFar said, think SOLID and make your own decisions based on principals.
You should also look into MEF for extensibility.
Rather a simple question. But the implications are vast.
Over the last few weeks I've been reading a lot of material about n-tier architecture and it's implementation in the .NET world. The problem is I couldn't find a relevant sample for Winforms with Linq (linq is the way to go for BLL right?).
How did you guys manage to grasp the n-tier concept? Books, articles, relevant samples etc.
UPDATE: I kind of wanted a sample app not just theory. I like to get into the specific implementation and then iterate the principles myself.
It isn't technology specific but this is a very good book about n-tier architecture: Patterns of Enterprise Application Architecture
No, Linq2SQL in the BLL is not the way to go for n-tier architecture. I would use it in the DAL.
I would suggest you start here, and keep reading. It is a simple concept, but there is a lot of literature out there to help understand it.
Try to understand the concepts first, without putting proprietary technologies into the mix. Once you understand the concepts, then think how to use things like Linq2SQL.
There are also about a billion posts on SO about this already, follow this link and cherry-pick the relevant bits from them
Can someone share their experiences with s#arp architecture. we have decided to follow mvp pattern for the project. Is this okay to go with it ? The size of the project is medium. we are going to follow the tdd and ddd.
Can anybody explain how to use this architecture means explain about the layers. we don't have enough time to go through with entire documentation. if anybody expalin particle with small example in short.
please help me out!!!
Thanks,
Milind
The S#arp Architecture combines ASP.NET MVC with other frameworks and tools like
NHibernate 2.0.1
NHibernate.Validator
Fluent NHibernate and
Castle Windsor (IoC).
It also makes use of the T4 templating engine of Visual Studio to create view scaffolds.
So you could also ask yourself whether you would like to use these tools, libraries and frameworks in your project.
Frankly, if you don't have the time to read the S#arp documentation, then building a project on top of it is probably not a good idea.
One could also say the S#arp arch doesn't hide the complexity of each of the above library and framework from you, so you have to be prepared to look into each of these as well.
The S#arp documentation and the enclosing sample app explains the purpose and structure of the different layers quite well.
The S#arp Architecture project home page links to an active discussion group. I suggest you browse the group messages and ask any questions you have there.
S#arp Architecture is a neat combination of some other neat tools, but you really need to take the time to go through the documentation and some examples. The time you spend reading and learning is a lot less than the time you'll spend refactoring and bug-fixing if you don't study.