Domain-Driven Design, Thoughts?

ActionScript, Book reviews, Design Patterns, Flex 8 Comments »

Domain-Driven DesignI’m currently reading Eric Evans’ book “Domain-Driven Design: Tackling Complexity in the Heart of Software“. Domain-Driven Design, or DDD, is about seeing the role of the model as the crucial part of a software project, about creating domain logic that is based on the model, about creating an ubiquitous language that is to be used by all team members (even non-technical) and much more.

This is exactly how I have been thinking about application design for quite some time now, especially since I moved from developing web applications that primarily dealt with CRUD operations to Flash platform development. The Flex projects I have been working on for the last years all have pretty complex domain models and they require a whole different approach and discipline in thinking about application architecture.

This might seem very obvious, but in a highly visual environment like Flex/Flash it is very tempting to focus on the User Interface first and hack together a “domain model” that really has a less important role. You end up with a weak model that is hard to expand, debug and Unit Test and in the end it makes you lose a lot of time.

This also gets me to think about the popular architectural Flex frameworks out there. In my opinion they break the principles of DDD by either providing base model classes that your domain model should be based on (Proxies in PureMVC) or by promoting the use of Value Objects as a domain model (Cairngorm).

We use Cairngorm in our projects but we (almost) never work directly on the Value Objects (or should I say Data Transfer Objects). Before an entity or a VO is sent or received, it is pulled through an Assembler that translates it both ways. It is obviously more work to create this mapping mechanism, but my experience is that it really pays off in the end. For instance, if you use remoting and are sending out or receiving domain objects, you have to make all your properties public or you must create getter/setters for them, you can’t properly use constructors since the AMF mapping relies on properties, you have to expose your arrays or collections in order to map them, … This makes the domain model more fragile, something you want to avoid as much as possible.

Another thing that is worth mentioning is the use of Repositories in DDD. Repository is very similar to the ModelLocator known in Cairngorm, but instead of having a singleton model, a Repository is created for a single domain entity. The Repository contains query methods to retrieve objects based on certain criteria. It also promotes not having too much associations between objects because those are hard to maintain and provides association lookup methods.

I’ll try to post an in depth review when I finished the book.

In the meantime, I wonder how many Flex projects are actually dealing with complex domain models and I’m even more interested in what frameworks are being used, if any. If you have any experiences or thoughts to share, please feel free to comment.


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Ship It!

Book reviews No Comments »

Ship ItI just finished reading Ship It! A Practical Guide to Successful Software Projects by Jared Richardson and William Gwaltney. With around 200 pages (appendices included) and a fluent and enjoyable writing style, you will devour this book in 3 to 4 hours.

This book is a collection of best practices, tools and proven solutions to many problems development teams are facing today. It touches on Tools and Infrastructure with Unit Testing, Continuous Integration, Issue Tracking, Feature Tracking, etc and on Pragmatic Project Techniques. Although Ship It! is not a hardcore technical book I can highly recommend it to everyone involved in software development. If you’re a developer, tester, team leader, manager or even a customer, you will gain valuable insights in the production of quality software.

Quoting the Pragmatic Programmers site:

“Many software projects run into trouble, and many never ship at all. Others run like well-oiled machines. This book shows you the basics of how to get your project well on the road to success.

Ship It! bucks current fashion trends and marketing hype; instead, you’ll find page after page of solid advice, all tried and tested in the real world: a collection of tips that show you what tools a successful team has to use, and how to use them well. You’ll get quick, easy-to-follow advice on modern techniques and when they should be applied.”

Buy Ship It! from Amazon


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 

Beyond Code - Learn to distinguish yourself in 9 simple steps

Book reviews 1 Comment »

Beyond codeI just finished reading Rajesh Setty’s “Beyond Code - Learn to distinguish yourself in 9 simple steps“. With around 120 pages and a simple language this is an easy and enjoyable afternoon read, which you can finish in 3 to 4 hours.

The core of the book is to deliver the theory behind success in professional life. It contains a lot of real world examples which make it easy to understand. In fact, most of the times I was “aha”-ing and nodding, because many situations have already happened to me or to people in my professional environment. Having them confirmed in this book actually felt very good and gave me a secure feeling, as if someone had been listening to me. It has given me an overall motivation and strength to decide on certain things in my career and I have a more optimistic view on my career at the moment. Every chapter also contains an exercise on the theory explained. This is the hands on where you get the chance to practice the concepts in real life and start making a change.

Main outline of the book

Part 1. The Inner Game

  1. Learn
  2. Laugh
  3. Look
  4. Leave a lasting impression
  5. Love

Part 2. The Outer Game

  1. Leverage
  2. Likeability
  3. Listen
  4. Lead

The Inner Game is about yourself and about how to look at work (and life) in a certain way, different than most people do. All the theory can be practiced alone. The Outer Game is about you and your environment. It’s about communicating with other people, knowing their skills and building a social network.

Quotes

Here are some of the sentences I marked. Read them and think about them. They have great value.

  • “All things are created twice. Once in your mind. Once in the real world.”
  • “If you are going to execute on a project that someone else sold, you are already at a disadvantage.”
  • “Research says that we tend to hire fast and fire slow”
  • “Hiring for attitude, training for skills.”
  • “Money can be earned back, but you can’t get back time.”
  • “You should already be acting as if you were already promoted, before you are handed that position.”

Conclusion 

I would highly recommend reading this book. It will make you feel more secure and confident. This is one of the books to refer to when you are in need of a guide in hard times. To quote Tom Peters: “Read it as if your life depends of it. It does!”.


Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner
 
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login