Rewriting Hello World according to SOLID in .NET

Introduction

There are numerous posts on this blog dedicated to various software principles. One of those principles is SOLID with special attention to ‘D’, i.e. the dependency inversion principle (DIP).

In this short post we’ll rewrite the classic introductory C# Hello World program according to what we’ve learnt before.

Read more of this post

Domain Driven Design with Web API extensions part 16: testing the MongoDb repository in the DDD application

Introduction

In the previous post we implemented the ITimetableViewModelRepository interface in the WebSuiteDemo.Loadtesting.Repository.MongoDb project. We saw that the implementation was practically the same as in the EF repository layer. The only difference was due to details in the MongoDb query syntax.

In this post we’ll finish off this extension series to the load testing DDD demo project. We’ll wire up the MongoDb repository layer with the rest of the application.

Read more of this post

Domain Driven Design with Web API extensions part 15: implementing the ITimetableViewModelRepository interface in MongoDb

Introduction

In the previous post we implemented the ITimetableRepository interface in the MongoDb repository layer. We saw that the code carried out the same type of logic as its EF counterpart. Most of the new things were related to MongoDb query syntax.

In this post we’ll implement the ITimetableViewModelRepository interface. Make sure you have the DDD demo project open.

Read more of this post

Domain Driven Design with Web API extensions part 14: implementing the ITimetableRepository interface in MongoDb

Introduction

In the previous post we looked at a couple of basic operations with the MongoDb .NET driver. I decided to include that “intermediate” post so that you won’t get overwhelmed with a lot of new code if you’re new to MongoDb.

In this post we’ll to be implement the ITimetableRepository interface in the MongoDb repository layer.

Read more of this post

Domain Driven Design with Web API extensions part 13: query examples with the MongoDb driver

Introduction

In the previous post we successfully seeded our MongoDb load testing data store. We saw that the Seed() method wasn’t all that different from its EntityFramework equivalent.

In this post we’ll look at a range of examples of using the MongoDb driver. We’ll primarily consider CRUD operations. Originally I wanted to simply present the implementation of the domain repository interfaces. However, I thought it may be too overwhelming for MongoDb novices to be presented all the new object types and query functions. The purpose of this “intermediate” post is therefore to provide a soft start in MongoDb queries.

We’ll be working in the MongoDbDatabaseTester project of the DDD demo solution in this post. Make sure you start up the MongoDb server with the “mongod” command in a command prompt.

Read more of this post

Domain Driven Design with Web API extensions part 12: seeding the MongoDb database

Introduction

In the previous post we constructed the database objects that represent the database version of the load testing domain objects. Recall that there’s no automated code generation and mapping tool for MongoDb .NET – at least not yet. Therefore decoupling database and domain objects with MongoDb as the backing store usually means some extra coding but in turn you’ll have completely independent database and domain objects.

We also inserted an abstraction and a concrete implementation for the connection string repository.

In this post we’ll seed the database with the same initial values as we had for the EF data store.

Read more of this post

Domain Driven Design with Web API extensions part 11: the MongoDb database objects

Introduction

In the previous post we mainly discussed the advantages and limitations of coding against MongoDb using .NET. We also discussed the MongoDb context a little bit and started building the MongoDb version of the repository. We said that there’s not much automation available in the .NET MongoDb driver compared to what you get in EF. However, that’s not necessarily a bad thing since you’re not tied to some “secret” and “magic” underlying mechanism that does a lot of work in the background. Instead you’re free to implement the objects, the rules, the conversions etc. as you wish. It usually means more code, but you get absolute freedom for your repository implementation in return.

In this post we’ll first add a new element to the common infrastructure layer. Then we’ll add the MongoDb database representation of our domain objects.

Read more of this post

Domain Driven Design with Web API extensions part 10: the MongoDb context

Introduction

In the previous post we installed MongoDb locally. We also started the MongoDb server and connected to it with a client. We then inserted a test console application into our DDD skeleton project, imported the MongoDb .NET driver and connected to the MongoDb server using the driver.

In this post we’ll continue to explore the MongoDb context and some practical limitations compared to the automated tools available in EntityFramework. We’ll also add a new C# console library to the DDD skeleton project. The new library will eventually contain the MongoDb equivalent classes of what we have in the WebSuiteDemo.Loadtesting.Repository.EF layer.

Read more of this post

Domain Driven Design with Web API extensions part 9: setting up MongoDb

Introduction

In the previous post we set out the main topic of this new extension to the DDD model project. We said that we would add another repository mechanism, namely MongoDb. We went through the basic idea and some terminology behind MongoDb, e.g. what a document, a collection or an object ID means.

In this post we’ll set up MongoDb locally and try to connect to it from .NET using the MongoDb .NET driver.

Read more of this post

Domain Driven Design with Web API extensions part 8: domain repository with MongoDb

Introduction

Some months ago we went through an updated series on Domain Driven Design starting with this post. We built a functioning skeleton project with EntityFramework as the backing store, a Web API layer as the top consumer, a loosely coupled service layer and a central domain layer with some logic.

In this extension series we’ll investigate how to implement the domain repository in a data store that’s markedly different from SQL Server. In particular we’ll take a look at the NoSql document-based MongoDb.

Read more of this post

Elliot Balynn's Blog

A directory of wonderful thoughts

Software Engineering

Web development

Disparate Opinions

Various tidbits

chsakell's Blog

WEB APPLICATION DEVELOPMENT TUTORIALS WITH OPEN-SOURCE PROJECTS

Once Upon a Camayoc

Bite-size insight on Cyber Security for the not too technical.