Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 11. The Service Layer > Strategies for Sharing Domain Objects between t...

Strategies for Sharing Domain Objects between the Client and Server

The most complex technique I’ve seen for sharing domain objects is to try to serialize the data and the behavior. One advantage of following this pattern is that new clients can easily create the domain model, including the business logic, simply by reconstructing the serialized information without prior knowledge. This usually involves creating an agreed-upon contract for rules and then providing complex sets of rules for the process. The second advantage is that rules can be changed on the fly and broadcast to clients without modification.

This type of system may sound exciting and flexible to build, but in my experience it adds several levels of complexity that often aren’t needed. I heard once that every hardcore developer feels like he has to write his own framework, and a business rules engine always seems to be on top of the list. In actual practice, however, I found that you seldom have a situation where nodes in the system are ignorant of each other. External systems are expecting your software to apply the rules needed and are often interested only in the data attributes, whereas internal systems are built and deployed in a cadence that makes sharing types between the clients and the servers straightforward.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial