Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Akka

You're reading from   Mastering Akka A hands-on guide to build application using the Akka framework

Arrow left icon
Product type Paperback
Published in Oct 2016
Publisher Packt
ISBN-13 9781786465023
Length 436 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Christian Baxter Christian Baxter
Author Profile Icon Christian Baxter
Christian Baxter
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Building a Better Reactive App FREE CHAPTER 2. Simplifying Concurrent Programming with Actors 3. Curing Anemic Models with Domain-Driven Design 4. Making History with Event Sourcing 5. Separating Concerns with CQRS 6. Going with the Flow with Akka Streams 7. REST Easy with Akka HTTP 8. Scaling Out with Akka Remoting/Clustering 9. Managing Deployments with ConductR 10. Troubleshooting and Best Practices

Identifying anemic vs rich models

Now that you've gotten a crash course in DDD, we can start to better articulate the possible weakness in the current bookstore model. In the opening chapter, I called the model anemic, which implies that it is feeble and not strongly representative of the domain we are working in. I didn't really back that up with too much explicit evidence though, so let's dig into how to identify an anemic model.

A major issue with this model, as far as I can see, is that the major entities in the system (Book, BookstoreUser, CreditCardTransaction, and SalesOrder) are implemented as simple case classes that have no functionality on them besides the setting of their attributes. All of the functionality related to dealing with those entities is done in manager actors, which is somewhat similar to services in the DDD lexicon.

Services should be ancillary in a DDD approach, but they appear central in our model, robbing the entities of the functionality related...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image