I am fresh out of college and I've been put on a project using the technologies/techniques mentioned in the title. It's all a bit mind boggling to learn these new patterns on such a large codebase so I was wondering if there is a sample app somewhere (something ridiculously basic like a phonebook maybe?) that will demo these patterns. Thanks!
(Castle Windsor is the framework in use and then there's a custom built ORM library)
"Who can help me" is a nice reference web app using Sharp Architecture (ASP.NET MVC, NHibernate, Windsor, repositories). It's not a trivial app though, but in a trivial app you wouldn't see how these technologies fit together anyway.
I liked the sharparchitecture.net Tutorial. Although it is a tutorial about sharparchitecture it covers testdrivendevelopment(TDD), ASP.NET, DDD, Repository Pattern and the use of Interfaces which is the base of IoC.
Related
I came with this mind problem lately when I discussed about a project involves various technologies such as WCF, EF 4 etc. So the idea is to keep a basic architerctural model, practises and layering, separation concerns and other stuff that should mind when you want to build something maintainable and testable.
So I came with this, what should I choose to implement when it comes to the presentation pattern? Maybe later I will need to use some of the layers to create a Windows Phone app to show some data from the service layer, or create a Silverlight client, a winforms client etc...
MVVM is presented better for Windows Phone, Silverlight the best option.
MVP as the winforms suitable presentation pattern.
MVC is best for ASP.NET Webforms? (seen some net examples using MVP for webforms).
[EDIT] Seems like a solution could be implement different approach for every UI and use tha same business logic and validation layer!
I guess you could use whatever you want...but is there anyone out there faced such a dillema? and what was he done about to solve it?
Thank you?
See my answer here: MVC3 and Entity Framework
in fact depending on which UI technology or platform you would use details at the top are different but the rest of the layering will most likely stay the same...
Just a way to start with and get inspiration, ask more if you need other details.
Im currently trying to refactor a project(asp.net mvc) that doesnt have any separation at all. just folders :s
The project has a bunch of EF Code First classes (People.cs, Exam.cs,
Message.cs, etc)
The project has several repositories (which all use EF Data
Context)
And of course a lot of controllers and viewmodels
We have a Tests Project but we arent very good at TDD so its not something we are really working on as of now.
I would like to have a clearer separation on the different responsibilities that the project has to address and would appreciate some advice on a good project structure that achieves this.
Please help.
thanks in advance
I would suggest following a Domain Driven Design (DDD) and one suggested way of laying this out would be creating the following projects:
Company.Project.Web <-- Your MVC Application, though you can still use WebForms
Company.Project.Domain <-- Data Transfer Objects (DTO's), ViewModels, Business Logic, Events
Company.Project.Data <-- Repository Interfaces
Company.Project.Data.EF <-- EntityFramework Specific Implementation of Repositories
Company.Project.Model <-- Your EF CodeFirst Classes
Company.Common <-- A common project of utilities and/or extensions
I would suggest you take a look at Project Silk http://silk.codeplex.com/ from the patterns and practices team. Great reference implementation of DDD, Repository, and MVC as well as mixing in HTML 5 and jQuery (vNext).
We use a similar design to that mentioned by jdmonty but a bit simpler. We do the following:
ApplicationName.Web - MVC Application
ApplicationName.Services - Business logic
ApplicationName.Domain - EF CodeFirst classes and the repositories
that act on them
ApplicationName.Common - Classes and utilities used by multiple
projects
ApplicationName.Tests - Test for the various projects
The Web project is dependent upon the Services project. The Services project is dependent upon the Domain project.
I am looking for an example of an asp.net website(with source), implemented with 3 layer architecture and has some complexities like user authentication and user permissions, etc. .
Does anybody know such an example?
If you're favouring ASP.NET MVC (and I would suggest you should be) then Nerd Dinner (source) is one of the best examples on structuring an application.
Personally I feel that rather than focus on n-Tier/3-Tier architectures you should focus your efforts on responsibly designing web applications using principles like SOLID.
KiGG is a nice application to use for reference.
Source code can be found on codeplex: http://kigg.codeplex.com/
I'm looking for a good asp.net webforms reference application.
We have some developers with VB6 experience, but no web application experience. I'd like to provide them with a couple of example apps that make use of a few simple forms, some user controls, db access, etc. An application that made use of a separate project for classes would be a nice bonus.
There seem to be a lot of very simple examples/tutorials for given features, but I can't find a good reference app that covers all of the above-mentioned topics.
Any suggestions?
I would recommend the ASP.NET starter kits here on the asp.net site. They are pretty diverse. My suggestion would be to actually try the hosted versions until you find one that suits the features you're trying to demonstrate. BeerHouse is a great start.
This one looks pretty interesting. It's a shameless plug for the Infragistics controls, but it looks like they're doing some non-trivial things:
The reference application shows the
use of web services, client side java
scripting, XML data binding and other
real world code samples.
http://devcenter.infragistics.com/RefApps/Expense/Expense.aspx
http://www.asp.net/community/projects/
Starter kits are a good place to look...
Are there sample ASP.NET projects around using the patterns discussed in the book by Martin Fowler (Patterns of Enterprise Application Architecture)?
I have downloaded the Northwind starters kit and Dinner Now, which are very good. Are there others that use things like Unit of Work, Repository, ...
thx, Lieven Cardoen
dofactory.com as C# and VB.NET GoF pattern examples. They also have a full ASP.NET web application example detailing the use of the patterns, although I don't think that is a free download.
You could maybe have a look at cuyahoga. It uses NHibernate (which is an implementation of the UnitOfWork pattern (and it also uses the identity map pattern).
The Composite Client Application Guidance for WPF has some examples of unit testing and nHibernate.
Also, if your looking for good nHibernate screencasts check out the Summer of nHibernate