Preface
I haven't updated my blog for a while. On the one hand, because of busy work, on the other hand, I have been insisting on designing and improving the application system development framework based on DDD recently.Apworks. I have read my field-driven design case: Tiny Library SeriesArticleMy friends must have heard of the apworks framework. Although this framework is not yet mature enough to be used in real system development, it has implemented the cqrs architecture model, it can be used for demonstration of software architecture design. Starting from this lecture, I will gradually introduce how to use the cqrs architecture to implement tiny library business. You may get bored: tiny library again. Can you change something else? I wanted to make a simple forum at the beginning, but in order to make readers and friends compare the classic DDD practice with cqrs practice, I decided to continue using the tiny library business.
Additional reading
Before reading this series of articles, if you have a domain-driven design (DDD), a separation of command and query duties (cqrs), event sourcing, and event store), WCF, Asp. net MVC and other concepts and technologies, please first understand these content. Here I will provide some links to help you.
- Domain-driven design Lite version
- Entityframework-driven design practices: cqrs Architecture Model
- Martin Fowler: Event Sourcing
- Evolution of DDD: cqrs and event Sourcing
- Wikipedia: domain-driven design
- Wikipedia: data context and Interaction
- Wikipedia: Command-query Separation
Download case
Invite readersHttp://tlibcqrs.codeplex.comDownload SiteSource code. Click Enter site homepage, and under the source code tab, select the latest change set. On the open change set page, click Download to download the sourceCodePackage.
System Requirements
- Microsoft. NET Framework 3.5 SP1
- Microsoft patterns & Practices Enterprise Library 5.0 (rjl 2010)
- Microsoft SQL express 2008
- Microsoft Visual Studio 2010 (vs2010 is required to open the solution)
- Apworks DDD framework (Http://apworks.codeplex.com). ApworksProgramThe set has been included in the source code package of tiny library cqrs. You do not need to download apworks separately.
Note: currentlyApworksThe framework can only be used for demonstration. It is still under development. Please do not use it for actual projects!
Installation and deployment
Follow these steps to install and deploy tiny library cqrs:
-
- Open Microsoft Visual Studio 2010
-
- OpenServer Explorer
- Email clickData connections, SelectCreate new SQL Server database Option
-
- InCreate new SQL Server databaseIn the dialog boxServer NameInput. \ sqlexpress, and thenNew Database NameInputTinylibraryeventdb
-
- Use the same method to create another database, namedTinylibraryquerydb
-
- In Microsoft Visual Studio 2010, openTinylibrarycqrsSolution
-
- InAdditionsRun the tinylibraryeventdb. SQL and tinylibraryquerydb. SQL scripts.
-
- Compile the entire solution
- InSolution ExplorerClickTinylibrary. Services. commandservice. SVCFile, selectView in browser, This will start ASP. NET development server, the port number is 1421
-
- Set the tinylibrary. webapp project to a startup project, and press Ctrl + F5 to start the application.
Run case Application
After the application is started, the following page appears:
Use the default account to log on to the system:Username: daxnet and password: 123456
Starting from the next lecture, I will introduce in detail the architecture and design ideas of tiny library cqrs. Coming soon!