Friday, May 31, 2013

Operator API : Domain services.

Base on the functionality would be provided by the operators, there are 3 major domain services have identify for the moment.
The are;
AuthorizationService, AccountService and TopupService. There would be more services added as the progress move on with the development.

Above 3 major domain services have split into their respective public contract and implementation.
The reason for having interfaces is to use IoC container to  resolve the dependencies ( Dependency Injection )

Figure 1 shows the AuthorizationService interface and its implementation.
Figure 1


Figure 2 shows the AccountService interface and its implementation
Figure 2


Figure 3 shows the TopupService interface and its implementation.
Figure 3





Note: Listed above interfaces are captures at the time of development in progress. There is a high chance them to be changed at a later stage of the project base on needing of the new requirements.

Thursday, May 30, 2013

Operator API : Analysing the DTOs to be shared with consumers.

Different Operators might have their own logic, Api implementations to support mSelfCare system.
It is required to have a contract between all operators how they represent the data to the LGN (Lanka Gate Network) as it will be hosting the mSelfcare service API to be consumed by the mobile consumers as well as the web site which will be hosted in the LGN.

It is identified that the domain entities will be the candidate for the DTOs to be shared between operators such as , Subscriber, AccountDetail, Services, Package, Topup Transaction and Other transactions.
So the analysis is to come up with all party acceptable DTOs.

Wednesday, May 29, 2013

Operator API : Operator.DataLayer

EF (Entity framework) facilitates quick and easy way of generating the database using the domain entities.
Having creating the initial database. start focusing on the data layer for the operator API.


Focus is to create a Generic Repository pattern to access underlying data storage.
Read on following articles on Repository pattern.

Introduction from Martin Fowler
The Repository Pattern in Msdn

My generic repository implementation

Figure 1 shows the interface.

Figure 1


Figure 2 shows the implementation of the above interface with EF DataContext.

Figure 2


Using the Generic repository. I was able to reduce the needing of individual repositories for entities.




Monday, May 27, 2013

Microsoft Entity framework (EF) Code First and Creating the DB using Domain entities.

Have been reading NHibernate fluent api and Microsoft Entity Framework EF.
Thought of using the Microsoft EF putting NHibernate fluent api aside.
I was able to find lot of help documents which relates to Microsoft EF also some good tutorials.
Having done the analysis of the domain model I was able to identify the domain concept which belongs to mobile operator's side.
Turn all the concepts into domain entities and create the data base using Microsoft EF code first.
without touching the MS Sql server.

Figure 1 shows the Domain Entities layout in the code

Figure 1



Figure 2 shows how the EF fluent API use to create the db using the entities.

Figure 2



Figure 3 shows how the Generated DB looks like using the EF fluent API.

Figure 3