Introduction
In this multi part series I am going to explore KiGG design and architecture as well as projects structures.
At the beginning I would like to give a brief about KiGG History.
About KiGG
KiGG is similar to DotNetKicks, Digg and DZone. However it much closed to DotNetKicks and way smaller than DZone. KiGG was founded by Kazi Manzur Rashid and first introduced in his article on DotNetSlackers.com: Kigg - Building a Digg Clone with ASP.NET MVC, that was on Feb 2008. It was built with First ASP.NET MVC preview.
In early this year 2009 on January, Rashid was almost done with KiGG, however ASP.NET MVC 1.0 was not released yet. At this time Rashid announced DotNetShoutout.com as first live application based on KiGG. On March 2009 Rashid released version 2.2 of KiGG after the release of ASP.NET MVC 1.0.
I joined the team on April and start working with Entity Framework implementation for KiGG as well as supporting the project.
Thank you Rashid for giving me this opportunity.
High Level Architecture
The below picture shows high level architecture of KiGG as I view it and tried to simplify it.
Figure 01- KiGG high level design
As the diagram describes, KiGG consists of 6 main artifacts, Infrastructure, Domain Model, Repositories, Services, Presentation and IoC/DI.
This is not the best design, and the design contains many sections in which we can tweak and tackle to provide better improved design. I am going to give a brief about each of these major artifacts.
1. Infrastructure
Contains definition and contracts for KiGG infrastructure. This includes logging, caching, event aggregator, background tasks, bootstrapper, etc… IoC/DI is also considered part of the infrastructure.
2. Domain Model
Domain models are KiGG entities such as participant users, stories, comments etc. Domain models are shared across and used by all artifacts as shown in the diagram. But models itself do not use any of these artifacts.
3. Repositories
Core data access definition. KiGG came with 2 repository implementation, first one based on LINQ to SQL, and the second is Entity Framework which support multiple database engine. Currently works KiGG works with SQL Server and MySQL. Repositories interacts with infrastructure to gain benefits of logging, caching and IoC.
4. Services
Contains different types of services such as story weight calculator, spam calculator, firing system events such as story published or submitted events etc… Services interacts with repositories and infrastructure. However it is not a rule that each repository has a service in services component.Services might also contain few background tasks.
5. Presentation
Presentation is implemented using ASP.NET MVC 1.0 with jQuery as scripting and AJAX framework. Presentation access infrastructure, services and repositories through IoC. This layer also has its own presentation domain models (View Data). Http modules and handlers also implemented in this component,
Conclusion
This is KiGG very high level design that shows core artifacts and high level communication between them. I can call bird’s eye view on KiGG from sky.
This is not the best design as I mentioned earlier, however we might refine it later when we move to .Net 4.0.
Read Part 2.