BackgroundMotion Code Sample
The BackgroundMotion community site and ASP.NET code sample that we worked with Microsoft to develop has gone live. w00t!
If you’re interested in ASP.NET you definitely want to check out the sample as it illustrates one approach to architecting .NET web apps. The architecture was really designed to facilitate rapid development so emphasizes things like testability etc. My personal highlights of the sample are:
- Use of a domain-driven design techniques. Repository and Unit of Work abstractions over LINQ to SQL
- Model-level validation using the Validation Block
- Dependency injection using Composite Web Block
- Using Lucene.NET to index a domain model
- Using MVP with declarative data-binding in the presentation layer
Let us know what you think.
Trackbacks
Use this link to trackback from your own site.



[...] sample application 20 06 2007 I found BackgroundMotion via Andrew Peter’s blog - created in partnership with Microsoft as a “best practice” example [...]
Hi Andrew,
I have been studying the background motion code now for a few days and have learnt alot.. so thanks!
What I would like to be able to do is base my core on the background motion core, but instead of using a composite web application I want to build the client with the new asp.net mvc framework.
Do you think that this would be possible? I’m just not to sure about the ModuleInitializer. I am hoping to be able to achieve this using StructureMap. Let me know what you think, and if I am going to be in for alot of pain :)
Cheers
Jake (ps I’m from New Plymouth and nz rulz!!)
Jake,
This would definitely be possible. The best approach would be to take a look at the StuctureMap integration provided by the MVC Contrib project.
Cheers,
Andrew.
I am reviewing your backgroundmotion code to see if I can reuse the repository code. My first question is why do you leave this method empty in the DlingRepository?
///
/// Saves the specified entity back to the repository
///
///
public override void Save(T entity)
{
}
Also, when I run the test, the validation always fail form some reason I am not sure yet. Do you have any ideas?
John,
Off the top of my head this is because DLINQ tracks modified object automatically and so there is no need to save them explicitly.
Not sure about the validation problem.
Cheers,
Andrew.
Hello,
This is a great project to learn things and see how things are done in real life. :)
I am working on the source for two days and still couldn’t solve how some classes and interfaces work. It would be great if there was a step by step guide or a documentation.
I want to use Core layer in my project but I think it will take more time than I thought.
Thank you.