Blog

Software July 24, 2017 4 min read Anup Marwadi

Evolution into DDD – An Introduction

Evolution into DDD – An Introduction

Over the last few years, we’ve run into scenarios that have led us down into a deep exploration phase on some of the “so-called” best practices in building quality software.

We have diligently followed the best practices as recommended by Microsoft and other giants only to find serious shortcomings when applications get massive.

As we started going down the rabbit hole, we discovered flaws in our approach, iterated to better approaches and eventually found a happy medium.

This is not a single post, it will be an exploration into different theories and will identify real issues solved from projects we have undertaken.

It is amazing how so many tutorials, code samples still indoctrinate the n-tier approach to application Development. If you are using this approach to development, I highly recommend you immediately stop and review the following Pluralsight courses immediately:

  1. Modern Software Architecture – Dino Esposito
  2. Making C# Code More Object Oriented – Zoran Horvat
  3. How You Can Implement Aggregates and Domain Entities Effectively in Domain Models, with .NET

  4. Domain Driven Design: The Good Parts – Jimmy Bogard

Approach 1 – Anemic Models

We took pride in building amazing Data Models, in fact we always started building applications from the Database Layer and delivered some amazing experiences to our customers.

The problem was that we were building all these “Anemic” data models that had no behavior associated with it. We had tons of POCO classes that more or less mirrored the persistence layer (aka the SQL Tables).

Most of our logic was written in the “Service Layer” that took care of getting these objects from the persistence medium and performed operations on it.

Approach 2- Anemic Models w/ Helper Classes and Extension Methods

As we started finding out that we were replicating a LOT of logic in the services, we started writing helpers. Helpers could be invoked on any object and it would open up a myriad of sub-helpers to accomplish the behaviors associated.

This approach works very well, mind you, it works so well that we almost started relying on these helpers for everything.

THE PROBLEM? Well, it still didn’t feel normal when coding. Dependencies between related entities started intermingling and it was nearly impossible to avoid circular dependencies as the business logic got more and more complex. More about this in future posts.

Approach 3 – DDD – Our Current Approach – Seems to be working fine as of this moment

After a lot of fighting with traditional, *recommended* approaches, we decided to give DDD a try.

We started with the concept of BOUNDED CONTEXTS and Aggregate Roots for a small sub-domain with the application to see if we could see benefits. We focused on building the Domain Model first. We really didn’t worry too much about persistence and focused on the various behaviors of the domain opposed to the persistence details. Persistence was only introduced towards the latter phases of the project when we were fairly confident that we got the basics right.

Approach 4 – In R&D – CQRS and Event Sourcing

We are currently evaluating CQRS and Event Sourcing, a natural progression of DDD to ensure that we benefit from the best of DDD and leverage some of the core tents of Command/Query segregation.

In Closing

As we mentioned earlier, this series is aimed at really digging down deep into the core of the Software Development and how procedural code evolves into Object Oriented code driven by Domain Driven Design. Stay tuned for future posts….

Frequently Asked Questions

Can I use PowerBI in a website?

Category: PowerBI

PowerBI offers a robust Web application that you can view and interact with reports from. However, if you need to use PowerBI from a 3rd party platform, you can always use PowerBI embedding. The pricing structure varies for embedding, please check the PowerBI website for more information.

Can you connect with 3rd party APIs?

Category: PowerBI

Yes, we connect with 3rd party APIs and pull data into your PowerBI platform on a regular basis. This requires additional custom coding or implementation of 3rd party tools like Zapier or Microsoft’s Power Automate

How do you charge for PowerBI services?

Category: PowerBI

We offer PowerBI services as a part of our HyperTrends Sense product offering. We usually charge an initial flat-fee for setup and data ingestion/transformation followed by monthly data management fees. Our pricing is simple, predictable and gives you the biggest ROI for your investment.

Anup Marwadi

Anup Marwadi is a technology entrepreneur, an investor and an avid-learner of business skills. He is the CEO of HyperTrends Global Inc. and TicketBlox and is currently involved in numerous advisory positions with Healthcare and Manufacturing companies. Anup is on a mission to build technology products that disrupt industries and help businesses grow by using technology and software as their primary differentiator. Anup is an avid traveler, a speaker and loves fitness and adventure. Anup is a board-member at Entepreneur's Organization (EO) - San Diego.

Leave a Reply

Your email address will not be published. Required fields are marked *

HyperTrends Global Inc.TM © 2024. All Rights Reserved.

HyperTrends Global Inc.TM is a Digital Innovation Agency with a mission to serve fast-growing businesses and help build their technology strategies