KiGG Design And Architecture – Part 1 The high level design

by mosessaur| 15 November 2009| 4 Comments

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.

KiGGHighLevelArch
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.

Comments (4) -

Yoann .B
Yoann .B France on 11/10/2009 6:09 AM Hi ! Nice to see you back.

Great post.

KiGG architecture is great but i think there is some mistakes.
I prefer full domain driven architecture.

Actually i'm working on a new architecture based on KiGG architecture with some improvements : domain driven design, extensibility (module/plugin based) using MEF, full separation of domain concerns

Modules implements their own Models/Services/Repositories...

I'll write some posts about that on my blog soon i hope !

See you later.

Yoann,
Muhammad Mosa
Muhammad Mosa Egypt on 11/11/2009 3:05 AM Cool, we admit that there are  mistakes! and this how we all learn.
I can say that Rashid knows exactly where the fall bits located. He highlighted some to me.

I it would be very interesting to see MEF on action on something based on KiGG.

I guess we might go into a refactoring iteration with KiGG. But I feel that this is going to happen with .Net 4.0. Not sure if we will be able to start with the beta or not. But I really wish.
Amr ElGarhy
Amr ElGarhy Egypt on 11/10/2009 7:07 AM Nice article, Really wanted to learn from KIGG design, specially from you, and seams you will teach us a lot in these posts. Thanks for this post and sure waiting for next great parts.
Muhammad Mosa
Muhammad Mosa Egypt on 11/11/2009 3:06 AM Thank you Amr for your kind words. I learned cool stuff from KiGG and thank to Rashid.
And I really wish what I've learned with everyone. specially those who follow KiGG

Pingbacks and trackbacks (1)+

Comments are closed