Using SOA on existing N-tier applications - ISerializable - Roy Osherove's Blog

Using SOA on existing N-tier applications

Udi Dahan writes very eloquently and shows a simple implementation example using Service Oriented Architecture.

While I agree with the main theme, I can't help but wonder, What happens when you need to introduce the SOA theme on an existing N-tier application?  Udi recommends:

"step 1 is to create a new layer, called Entities ( or something else if you prefer ) and copy all the classes of your BL that are part of the domain model to it. Next, remove all methods from those classes"

If I got this correctly this does not take into account a (probable) situation in which the application needs to add services to it's functionality while keeping the current behavior for existing clients. You can't just move half of your logic layer into a different one. Instead it seems to me that a services layer can be put on top of the existing logical layer as an optional way to communicate from the client. This way existing client applications that used the N-tier model successfully can keep using the logic layer directly, while the services layer allows remote clients access the logical functionality using a fixed set of one-entry point classes, much like Udi's description. Am I missing something here?

Published Sunday, January 18, 2004 12:58 AM by RoyOsherove
Filed under:

Comments

Sunday, January 18, 2004 9:29 AM by TrackBack

#

<p>
Before getting into the responses of the blogosphere to my last post, I wanted to reiterate what it was about. The purpose of my post was "assuming that you know how to build a LA, how do you go about migrating to an SOA". Meaning, how do you migrate your existing ( and probably well-founded ) knowledge of LAs to knowledge of SOAs.
</p><p>
Now, I'd like to acknowledge the following posts that referred to my previous post on "How To Do SOA":
</p><p>
My good friend Roy Osherove, as always raining compliments down on me, writes <a href="http://weblogs.asp.net/rosherove/archive/2004/01/18/59743.aspx">"Using SOA on existing N-tier applications"</a>, but I'm afraid that there was a misunderstanding here. "when you need to introduce the SOA theme on an existing N-tier application" is not at all what I was attempting to show. Should you have a working application, do NOT change its architecture unless absolutely necessary. No, "SOA is cool" doesn't count.
</p><p>
I think I should stop a second to make a distinction. The definition of SOA has not yet solidified. The way I see it, there are 2 distinct and complementary views. 1. SOA is about how to integrate different systems. 2. SOA is about how to architect a single system. ( Steve pushes the first view with his post: <a href="http://hyperthink.net/blog/CommentView,guid,ca7bc7ce-3fd6-4106-86fd-9cfb930a2ec6.aspx">"Making the N-Tier to SOA conversion"</a> )
</p><p>
What I was referring to in my previous post was in the light of the second definition. What Roy refers to is more in line with the first. I won't be getting much into how to do the first kind of SOA, because there are big vendors out there that plan to make loads of money based on that definition. I'm more interested in helping Joe Developer use a new(old) paradigm to develop systems which, IMHO, is the most suitable today.
</p><p>
Let me reiterate. SOA is how to architect a system ( according to view 2 above ). You would be best served choosing this architecture before starting to code, than after. Even the Agile camps have a System Metaphor which must(?) be decided at project start which guides them throughout the project lifecycle - of course, it evolves over time.
</p><p>
Both Roy and Steve make valid points about putting a facade over existing parts of a system to expose them a services. In this way, they continue to support existing client code that is already dependent on it. I totally agree !
</p><p>
But, if your starting a new system, wouldn't it be preferable to have all client code access the given functionality in the same way ? Maybe/Yes.
</p><p>
Wouldn't it be that much easier to scale out the system if/when necessary ? Yes.
</p><p>
Wouldn't it make the client code loosely coupled to the functionality ? Yes.
</p><p>
Wouldn't it make the functionality itself more testable ? Yes.
</p><p>
Wouldn't it be that much easier to handle logging, exception management, security, and other cross-cutting concerns ? Definitely.
</p><p>
<pause />
</p><p>
I've reached a conclusion. My next post won't be so much of an example of an implementation of a service. My next post will be about replacing the BL as we know it. I think that once you'll see what the BusinessService looks like in a system with an SOA, things will become that much clearer.
</p><p>
Of course, should you have something you're dying to see next, let me know =)
</p>
Sunday, January 18, 2004 4:40 PM by Udi Dahan - The Software Simplist

# re: Using SOA on existing N-tier applications

Roy,

Your too kind ! However, my intent was slightly different - and can be found here:
http://udidahan.weblogs.us/archives/012770.html
Thursday, January 22, 2004 10:56 AM by TrackBack

# But that trick NEVER works

Wednesday, February 04, 2004 6:11 AM by TrackBack

# Service Oriented Architecture (SOA)

Thursday, April 05, 2007 5:55 AM by » But that trick NEVER works

# &raquo; But that trick NEVER works