Udi Dahan   Udi Dahan – The Software Simplist
Enterprise Development Expert & SOA Specialist
 
  
    Blog Consulting Training Articles Speaking About
  

Author Archive

I'll see you when you get there

Saturday, January 17th, 2004

How to do SOA ?

That’s a question that’s been popping up a lot lately. I’ve been answering small facets of the question in comments all over the place, but I think that it’s time to handle the big one.

First of all, I assume that the architecture that you’re currently using is a layered architecture ( N-tier counts despite the “tier” misnomer, N=3 is also OK ). What I’m going to do is to do a step-by-step migration from a layered architecture (LA) to an SOA.

First some history. In your basic 3 tier LA, the layers are PL, BL, and DL. PL = presentation layer, BL = business layer, DL = data layer. Over time, people realized that layers were a nice abstraction and started changing the above layers to a system with more layers. For instance, tables in the database were the storage layer (SL), data access code to interact with the storage was often split into 2 layers – database Dal ( data access layer ) consisting primarily of stored procedure, and the app Dal which was code that exposed those sp’s to the system in its own framework. ( Note that in many cases it is possible and even desirable to do away with the stored procedures and have the same sql code in the app Dal. ) The BL primarily was implemented by Fowler’s Domain Model Pattern – rich objects holding both the data, behaviour, and “structure” of the system ( think Customer.Orders ). The PL use of the BL was by way of its objects. In other words, the PL was intimately aware of ( and dependant on ) the BL’s inner workings.

So … What’s the problem ? Well there are quite a few, and I’ll eventually make some exhaustive list of what the problems are, and why you should move to SOAs. For one, the BL may be a good API for working with it in process, but if you start to use them for remote invocation your performance will die. Why ? Because the BL is chatty, meaning everything is done in small bites – give me this, now give me that – when what is needed for remote clients ( or other systems ) is a chunky API – give me everything I need at once. Well, this problem can be fixed by putting in another layer, but I won’t get into that ( unless you ask nicely =) ).

So, assuming that you know how to build a LA, how do you go about migrating to an SOA ? Here’s how.

First you have to change your layers so that they behave like services. Then, if you want, you can wrap them up using webservices or some other plumbing choice. You’ll need to have a standard way for passing data to your services ( SOA’s schema ). How do you do that ?

Well, there’s implicit knowledge scattered all around the system. Its the domain itself. The PL presents it. The BL performs logic on it. The DL stores it. Its data. It doesn’t have behaviour. These are the “entities” of the system. What are the entities you ask ? They are the objects in your BL without the behaviour. Customer, Order, Product, etc, all these are entities that ALL parts of the system deal with. This is the stuff the will be passed between the services. If you wanted to integrate with other systems, you could easily serialize the entities to xml.

So, 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. There is some disagreement on whether or not the relationships should be left in or handled by a different service. ( I’ve tried using a separate service for handling relationships between entities with quite a lot of success, but can’t generalize it enough to push for it as a part of the SOA proper. )

So, from now on, whenever you have to pass data between layers, use the corresponding entity.

So, you now know how to get data to your service, but its still a layer. So lets change the layer to a service. A service has a single point of entry, allowing only method calls. So …

For each layer, make only one visible class, something like ($WhatYourServiceDoes)Service – like PersistenceService or AuthenticationService. I can see your getting mixed up.

When working in .Net, I have a project called PersistenceService, in it I have a class called PersistenceService. When somebody needs persistence services, they add a reference to the PersistenceService project, at the top of their client code file they write “using PersistenceService;” and then, in the code itself, when they write “PersistenceService.Update(u);” they are actually accessing the PersistenceService.PersistenceService class – it just makes it more readable like this.

All other classes inside a service are internal, nobody should be able to get at them. The public class has only public static methods – like “public static void Update(Entities.User u)” mentioned above ( you might want to return bool in your specific case, or maybe int ).

Now, the public class handles all security, logging, exception management, and other infrastructure code for each call, finally passing the call on to an internal class which holds the logic for actually doing the work.This class has almost the same structure as the public class and is the one in charge of actually getting the work done. There’s no problem in instantiating other objects there to do the work.

In SOA, not everything is a service. /* cheap shot at the OO crowd */

<aside> This is getting rather long … </aside>

Its time for some examples ( I’ll only be showing the SOA way ):

1. Login ( From your PL call this instead of what you did before )

<code>

Entities.User u = new Entities.User();

u.Username = txtUsername.Text;

u.Password = txtPassword.Text;

if (AuthenticationService.CanLogin(u))

  // let the user continue

else

  // show some error message (ask them to try again ?)

</code>

The AuthenticationService has a CanLogin method which takes the user’s credentials from the entity, authenticates them somehow, and returns the result.

Why is this preferable to having a BL.User.Login() method ? Well, is it really the user’s responsibility ( in the “real” world ) to authenticate themselves ? No. If you’d like to change the mechanism for authenticating users ( say moving to ADAM instead of a DB ), is there any reason to touch the User object ? No. There are more reasons, but let’s not get into that.

What is needed is a separation of concerns. How you do something and where you do it (even at the interface level), should be separate from what you do it on.

So, to sum up, make layers into a services. And when you pass/get data to/from a service use entities. Next time, I’ll go about implementing an entire service, something you doubtless have as a layer in ( at least one ) system, so that all this theory makes more sense.

BTW, if you have anything you’d like me to include in the next post specifically, let me know.



VB User Group Meeting

Monday, January 12th, 2004

I will be presenting at next month’s ( February ) VB.Net User Group Meeting in Israel.

Lecture Topic: “Practical Caching”
 
  First hour:
 
    How caching can improve AND degrade performance.
    How to tell if a particular performance problem can be improved by caching
    ASP.NET caching techniques, tricks, tips, and gotchas
 
  Second hour:
 
    Microsoft Caching Application Block ( CAB ) deep dive:
        What problems it solves, what problems it doesn’t
        What can  you learn from it to improve your code
        How and when to use it in your applications today
 
  Technologies that will be encountered:
    ASP.NET, ADO.NET, SQL Server 2000


Re: As the pendulum swings

Friday, January 9th, 2004

Mark Bonafe wrote an interesting post on the whole OO vs procedural debate and how SOA may be just the return to procedural programming.

The problem I have with this, and several other posts on the topic is this, SOA has almost nothing to do with programming. Its about the (functional and non-functional) decomposition of a system. What are its main building blocks. And you know what ? Programming language/style has little do with it.

Frans Bouma asks if “OO is the goal or the tool” ? My answer: I have one goal, and it has nothing to do with OO, SOA, or Domain models. My goal is for my clients to be happy with the system, and to make a profit.

Anything that drives me to this goal is welcome. It used to be that OO was my favorite tool/roadmap, today I use SOA for architecture, and OO for the actual development. Gone is OO Analysis and Design at the system level, supplanted by SOA.

I find that the pendulum doesn’t have much to do with it, and here’s why. SOA isn’t about code, OO is.

I think that it is common knowledge in the industry, that the larger a project, the lower chance that it would succeed. Even ( especially ? ) if using an OO methodology ( aghh! the “M” word ! ). Anybody wondering why ? Could it possibly be that the methods that we were using for small-medium scale development efforts in the past don’t work so well on big projects today ?

I think that the main reason that OO couldn’t hold up, was that OO was about modelling the world – for every object in the real world, we’ll have an object in code. Big systems aren’t so much about objects in the real world, but more about interactions, processes, and flows.

This may sound like the pendulum swinging back to procedural programming, only, its not programming. Its about the system’s architecture. And its not done by programmers using a computer language, but rather by business drivers and 30,000 foot architects. ( I actually wish there were some “low-level” programmers that brought them down to earth every now and then ). These are the people who tell us what we need to build.

Here’s a hypothetical discussion between a business driver(B) and an architect (A):

<anecdote>
(B)We need to a way to save the data we get, and use it later. (A)We should have a persistence thing (service) in the system.

(B)We need to do all sorts of checks to see that the data we get is valid. (A) We should have a validation thing too.

(B) We need to integrate this stuff with our partner companies’ systems. (A) Well, we need some way for our systems to talk together – webservices might work, but our development shop knows more about MSMQ. But, we’ll need to have a way to move to different communications later. We should also have something to authorize things ( authorization service ).

(A talking to staff later ) I guess we need some way to get all of these high level requirements to fit together. Did somebody say OO ( or OOD&A ) ? That has nothing to do with any of this stuff ! What we need is something to tell us about how to structure a system to do all this.
</anecdote>

SOA is about what the major building blocks of a system are, and how they work together. In other words, the executive summary. This IS the system. OO is how to build each part – or, at least OO seems to be the best tool we have today for actual development.

Frans – SOA is about WHAT is the system, not so much as to WHY. The why is actually quite simple – “because that’s what the client wants”. OO is, as you said, about HOW to get it done.



A collection of comments

Friday, January 9th, 2004

After spending quite some time commenting on other people’s posts about SOA, I thought I’d bring them all together in a post. My apologies for not editing it into a single coherent post.

Following “Adventures in SOA, Part 2”: from my comments:

If you want to go SOA all the way, Fowler’s domain model doesn’t quite fit. This is because it exists in the context of an OO architecture.

For instance, in an SOA there is a persistence service to which you send entities (entities are objects without behaviour); rather than calling myCustomer.Save() you would call your persistence service and pass in myCustomerEntity as a parameter.

SOA is a different way of thinking about systems. In order to migrate my thinking from OO to SO, I started by introducing a facade for each layer. The only way I could interact with a layer was through the facade. So, instead of doing:

new BL.Customer().GetById(id);

I would call:

BL.Facade.GetCustomerById(id);

This morphed my BL layer, for all intents and purposes, to a service. From there, things sort of came along by themselves.

In a general view, an SOA has a coarse grained Business service which replaces the Domain Model pattern in an OOA. The Business service uses a business rules service/engine for determining whether actions can be performed. Rules include things like DoesOrderQualifyForADiscount(Order o).

In many cases it also makes sense to have a validation service for lower level checks. The lowest level checks, nullability and string lengths for example, can be implemented in the entities themselves.

I find SOAs to be more suited for today’s development challenges than OOAs since they allow for an increased separation of concerns in systems.

Following “Adventures in SOA, Part 3”: from my first comment:

I’ve just become a little disillusioned about OO architecture.

Why ?

Because of the “Where does this go ?” syndrome. This syndrome attacks after you’ve already built quite a lot of the system, and usually takes the form of some method you need to add, but just don’t know to which object.

For example, I do a lot of systems for academic institutions, and the following requirement sums it up: A lab administrator registers a student to a final project, for a course that the student is registered to in the given semester.

From this I know I need a “RegisterStudentToFinalProjectForCourseAndSemester(Student s, Project p, Course c, Semester r)” method. But where does it go ? On the LabAdmin class ? The Student ? Project ? Course ? Semester ? Eventually I just pick one and moved on.

What’s the problem with this ?

Well, the class that I choose becames tightly coupled to all the other classes. Martin Fowler probably would have found a nice solution using aspects ( as Brian McCallister posted here: http://kasparov.skife.org/blog/2003/12/27#design-ideas ), but I am not so skilled.

I look for architecture to push the developer into consistently making good choices ( see The Pit of Success, a la Brad Abrams: http://blogs.gotdotnet.com/BradA/PermaLink.aspx/b7a0cf5c-a283-4f95-a508-819102d2feae ). Unfortunately, in an OOA Joe can make bad decisions that will have far reaching ramifications on the entire system.

IMHO, services are a step up on the ladder from objects when it comes to architecture. Services will become the major building blocks of the future. Finally, services encourage developing coarse-grained APIs, which is exactly what will be required when the services will be distributed throughout the enterprise. Essentially, this will force us developers to deal with these important issues ahead of time. And, well, its nice to get things right the first time around. Isn’t it ?

from my second comment:

One final note =)

The example I gave of BL.Customer().GetById(id) and BL.Facade.GetCustomerById(id) was given in the context of migrating OO thinking to SO thinking. This is by no means a “Rule”.

Once you give up the “everything’s an object” way of thinking, and begin to adopt services when they seem to fit, then the system’s structure becomes more suited to the tasks its required to perform. Which leads me to persistence as a service.

Although I’ll probably regret this, the great O/R debate that’s been raging recently seems to focus too much on a relatively minor portion of moderate and up complexity systems. Yes, persistence is important. No, it should not be the driving force behind your entire architecture.

And, in all this debate, nobody stops to talk about the business rules. Who says myCustomer.Save() is allowed to be called now, in this context, by the current user, etc. Where does this code fit in ?

I guess the one thing that I can say here is this: Don’t lose sight of the forest for the trees.

Following “Adventures in SOA, Part 4”: my comment:

The service should not be implemented as:

AuthenticateUser(username, password, application)
AddUser(name, address, etc)
UpdateUser(userId, name, address, etc)

But rather:

AuthenticateUser(Entities.User u)
AddUser(Entities.User u)
UpdateUser(Entities.User u)

Where Entities.User has the following properties:

int Id { get; set; }
string Name { get; set; }
string Address { get; set; }
etc…

Note that you would implement basic validation checks in the setters – such as checking the string passed in is of the appropriate length.

Now the Entities “layer” is really just a part of the common type system for the application. So, when distributing your services and setting up the calls over web services or message queuing, these entities will be passed as Xml.

This is how you move to the “Share schema, not type” directive, since, all these entities in essence just define a schema. From an implementation perspective, yes, they are a type too, but that’s really just internal to the service.

And a final note:

The set of Service Layer, Remote Facade, and Data Transfer Object patterns ( from Fowler’s PoEEA ) are essential components of SOA. The Data Transfer Object pattern is implemented by what I call entities. These entities form the schema in SOA.



Images – Where do they go ?

Saturday, December 27th, 2003

After going through several articles and posts and comments about images, I’ve decided to devote some space to the issue here. The treatment will be done at system-wide levels, meaning with an eye on all the *ilities. The debate is between saving images to the/a database vs saving them to disk. My choice is disk. Here’s why.

First of all, some history. Once upon a time, the way all web apps handled images was with the <img> tag using the “src” attribute to point to the relative location of the image on the server’s disk.

Over time, the idea of keeping all entity information together spread, and we began saving images to the database, and then returning them to the client by streaming them over HTTP. We began using the “src” attribute of the <img> tag to point to .aspx pages or .ashx handlers which would return the image to us. Thumbnails and zoomed in images were created on the fly by these techniques and everything worked. But not for long. These techniques begin to break down when the load increases.

What are the problems that occur when saving images to the database ? Well, for starters, if you save the image in the same table as you store the rest of the entity’s information ( for instance your employees table ) you will most likely overrun the page size for the row causing it to be split over multiple pages. This adversely affects performance. ( Note: if you do decide to go this route, I suggest creating a separate image table where you have an Id and the image itself. Then, from your entity table – employees – use a foreign key to the image table. )

Although the previous problem adversely affects the performance of the database engine, this next problem is more of a gotcha. When saving images to disk on the server, the client is able to cache them by itself to its own disk. This reduces the web server load over time as it has less bytes to serve. When images are referenced by “GetImage.ashx?EmployeeId=12”, although you can cache the bytes retrieved from the database in memory on the web server, the client doesn’t cache them to its disk. This further reduces the scalability of the system.

Finally, consider the issue of multiple sizes of images – thumbnails, zooms, etc. Although these can be dynamically generated quite comfortably with “GetImage.ashx?EmployeeId=12&Width=100&Height=100”, this increases ( per request ) the number of CPU intensive operations needed. A prefered alternative is to automatically generate all the image sizes required once, save them to disk, and serve them like any regular image.

Personally, I use an Imaging service for all of these needs – saving the original image to disk, generating thumbnails, getting the path of an image for a given entity ( eg. employee ) and a given size ( eg. zoom ).

Finally consider the case where you have a large volume of images to serve. Better to have a single server, with ultra-fast disk access + Raid, which serves all images. This server, when separated from the database server, would greatly increase the manageability of the server farm and make diagnosing performance problems much easier.

To conclude, although an interesting capability, saving images to the database begins to pale when compared to alternatives under load. Don’t get me wrong, for small systems it may be the simplist 🙂 thing to do, but, time and time again, that small system you built 2 years ago is required to scale and support much more than you originally intended. And, its really not that hard to work the “old fashioned” way. ( Note: run-time generated graphs based on data should not be moved to disk. )



SOA & Persistence – Its all about Services

Tuesday, December 23rd, 2003

I’ve been contemplating the move to SOA style development for some time now, but recently I’ve taken the plunge. I’m talking, of course, about giving up OO as a way of life. Not everything is an object.

I have a lot to say on the subject, but my main focus will be on the impact SOA has for developing a system. That’s right. One system. Not how to connect different systems using XML Web Services.

On that note, I’d just like to debunk a myth I ran into recently a la 15 Seconds : Realizing a Service-Oriented Architecture with .NET. The following image appears to be “common knowledge” when talking about SOA. Anyone see the problem ?

Hint: its between the Business Objects and the Data/Persistence.

wrong_SOA.bmp 

The problem is that persistence is ( or at least should be ) a service. The business objects themselves should not be aware of their persistence. Rather, the services above should use the persistence service in order to perform the work needed.

Instead of: myCustomer.Update();

Should be: Persistence.Update( myCustomer );

Why is this important ? Because it contributes to a separation of concerns ( see Agile Management – http://www.agilemanagement.net/Articles/Weblog/Separationofconcerns.html ). Obviously, putting the knowledge of persistence ( or, for that matter, anything else ) into business objects creates bloated objects that need to know everything about what can be done with them. I’m sure that this will just further inflame the great O/R mapping debate ( see “Futility of Object-Relational Technologies” and “GENerative Object Mapping Layer” ) but it is still true.

Coming up next:

How to do persistence with SOA.



This Consulting Business

Monday, December 15th, 2003

Several times in the career of a “programmer” one considers opening up shop and becoming his own boss – becoming a Consultant ( the capital C stands for the extra money consultants demand ). Brady brings up some interesting issues budding consultants often encounter. Robert offers some really great advice from his own consulting process. I especially appreciate the value of using escrow services. (Update: Robert adds some more advice here ) I’d like to share what little experience I’ve gained over the years in the hope that some other consultant just starting out may save himself some grief.

From my experience, the main skills area that needs improvement in programmer-turned-consultants is project management. This area deals with everything around the actual product/system developed. Development really isn’t the problem. Bottom line – first and foremost, READ ! Anything and everything about project management, contracts, RFPs, and all other things relevant in some way to the project. The hard part is always implementing all the great accumulated wisdom out there.

The most critical thing to remember is: It Takes Time.

Not pure programming, in the zone, 100% productivity time. Time to develop relationships with stakeholders. Time to go through the RFP/RFI process. Time to negotiate. Time to travel ( a lot of people when starting out forget to take this into account when budgeting – it IS time spent on the project, and should be measured – at the very least). Time to meet with users. Time to learn the terrain. Time to reconcile differing views. Time to play politics. … Time.

Obviously there isn’t enough room here to go over all the skills and techniques of project management and consulting, however, I would be remiss if I didn’t come full circle from time to money.

First of all, unless you have a signed contract, signed detailed project description document, etc… no project will be done in 2 months. Once you have all those things, AND there are NO mid-project changes, then you have a case of “contract programming” mentioned in the comments of Brady’s entry, which has a chance of being done in 2 months.

However, there are end-project activities which have to take place, installation, training, support ( yes, even if you didn’t include it in your offer, if you don’t give some support for the bugs that will doubtlessly come up, the project will be labeled a failure. ), meeting with the major stakeholders to see that they’re happy, … you might as well not have done the project.

So, in essence, once you’re a consultant, work != programming. In the vast majority of cases non-programming.Time > programming.Time. Its this mindset that has to take hold. This particularly becomes difficult when a potential client comes to you with a project that sounds exactly like something you just did. It happened to me recently. A client asked for a system that I just finished rolling out at a different client, and I thought: Easy money. Well, the politics there were like nothing I’d ever seen. The project took even longer than at the first client, even though the code had already been written !

Bottom line: Everything is a project, and must be treated as such.

Now, getting to money. Money is important, and so is when you get it ( see Robert first post about milestones ) and making sure that you get it ( Escrow a la Robert ). And, don’t forget taxes. For one-person shops that aren’t overflowing with projects, deferring a payment to a new fiscal year can make a big difference to your net income, and may buy you a favor with the client if you play your cards right.

Of course, no discussion about money and consulting would be complete without raising the issue of hourly vs flat-fee pricing. Most clients prefer fixed price offers, since they fit with their yearly budget planning.

Many consultants I’ve met use hourly fees, but billable hours is a fickle measure that varies from project to project. Personally, I have certain issues with the hourly pricing model – note that I’m referring to the invoice the client receives. When charging hourly, the client will obviously want to know what you did on an hourly basis. Try explaining to the client to pay you $X/hour for having lunch with the head of computing services to make sure that he was pleased with the effect the project had on his department.

Fixed price offers allow a consultant to roll up many project expenses that are often difficult to collect from clients in an hourly model. For those who are skilled in project management, this model often works well. However, the risk involved in under-estimating scope, or time required, may adversely impact the bottom line.

Recently, after reading this great article on Value-Based fees, I’ve had great success in this model. In a nutshell, you, in cooperation with the client, assign value to each deliverable, and price it. This model handles scope creep very elegantly. For lack of space, I suggest you go read the entire article. Moreso, the “Million Dollar Consultant” has a whole page of tips for those going the consulting route. Highly recommended.

To sum up, to succeed in consulting one has to treat it as a whole different career path to be learned and lived. Think “Career Calculus” by Eric Sink. More importantly, consultants are PEOPLE people, not computer people. Soft skills rule.



On Prototypes

Thursday, December 11th, 2003

Prototypes. They’re everywhere. Sometimes they grow into full-fledged systems. Sometimes they’re thrown away. But they can be considered a project in their own right. I’ve decided to write this entry after reading Fabrice’s thoughts on the same subject. Before getting into my own thoughts on the matter, I’d like to quickly sum up the main points I found there, including the comments posted.

The main issue originally revolved around web apps, and whether HTML or ASP.NET should be used for prototypes. Powerpoint, Visio, Paper – yes that stuff that comes out of printers, Photoshop, Illustrator, and Denim were all brought up. Arguments for and against were made. Before I pick a side, I thought I’d return to the basics.

A prototype, by definition, should be thrown away. The lessons learned, obviously, should not.

I bring this point up as it is the most basic. When thinking about prototypes, the last thing that should concern us is if we can “reuse” pieces of it for the actual system. Now, if the point of the prototype is to learn, and learning is most facilitated by short feedback loops (tons of research back this up, think pavlov), we should be looking for the “technology” that allows for the quickest feedback.

What do I mean by feedback ? What the client thinks about what we’re doing. And what’s the fastest form of “do something, get feedback” ? Talking. What we need is a way to actually DO the prototype WHILE talking to the client. This pretty much reduces the number of contending technologies down to 1. Paper.

Paper prototyping, when done well, brings to light SO many issues and unspoken assumptions in SO little time, that, from my experience, it just doesn’t make sense to go any other route. There is so much information out there on paper prototyping that I can’t even begin to list it here. Just google it.

So, how can paper prototyping be done well ? Well, it requires preparation, and, obviously, lots of paper. Plan for about a 1 hour sessions at a time with the client, no more. These sessions are VERY tiring. If possible, try to get someone to write down everything that came up during the session, and what resolutions were reached. This person should not be involved in the session beyond being an observer.

Now, let’s consider the alternative. Using a computer + some software, be it Visio, Photoshop, whatever. The problem with these approaches is that we get to focused on what we’re building, and lose focus of the lessons we should be learning. These approaches obviously increase the time between a decision we make about the system, and getting the client’s reaction. It therefore also increases the time we waste when we get a decision wrong.

The Agile world has already come to this conclusion and makes every attempt to get a real, live customer/client/user on-site for the development of the actual system. When building actual systems, obviously, paper can’t be used. But where it can, and it’s most appropriate, it should.

To sum up, when a prototype is done, we should know more about the real system that we’re building than when we started. Short feedback loops with our clients is what gives us the most information. And paper is the medium most suited to short feedback loops when dealing with prototypes.


Update:

Six Signs That You Should Use Paper Prototyping from Java.Net

Sign 1. There are many different ideas about the design

Sign 2. You find yourself defending a particular design

Sign 3. There are parts of the design you’re unsure about

Sign 4. You’re changing the way that the users perform a task

Sign 5. The concepts or terminology are new to the users

Sign 6. You’re feeling uncreative



SOA vs? XP – well, maybe A vs XP might be more appropriate

Sunday, December 7th, 2003

There’s a building buzz about SOA. I don’t think that anyone can argue with that. Also, I believe that for large systems, SOA will become the new paradigm. Don’t take my word for it, the PAG group at Microsoft have recently began rolling out ShadowFax, the still emerging definition of what Microsoft sees as SOA’s future.

Now, as a developer, I am pro TDD, using it constantly and consistently. I have been thinking a lot about XP as a way of developing systems in teams. The success stories have been increasing over time, and XP appears to be a valid development methodology in its own right. Not only XP of course, the entire Agile camp ( XP, Scrum, DSDM, etc ) has been raising some serious concern in “heavy” development shops.

What interests me is the mesh/meld of Architecture ( yes, with a capital A ) and agile methods. It would appear that the two, although not entirely opposed, don’t quite fit. Agile methods allow the system’s architecture to unfold as the system is built, keeping it as supple as possible. The architecture camp, of which SOA is a member, define the system’s architecture up front. Of course, small intra-service development efforts could occur before or in parallel to the architecture definition process, however, their effect on it would be minimal at best.

From a historic perspective, I think that where SOA comes in, Agile methods have yet to be introduced, or, if they have been already introduced, the data as to the success of agile over non-agile are inconclusive at best. Very Large Systems ( once again, capitalized ), like those developed for financial institutions, the military, and government have seen very little agile action at the project-wide scale. These systems have multi-year development+deployment schedules. I have recently done a stint at one such project. Waterfall, although not called by name due to recent bad press, is still used, but under the guise of tailoring some other development process.

On these large-scale development projects is where SOA will have the short-term largest impact. This is for the simple reason that project architectures are all different, but there’s nearly always only one development methodology for the company. The entrance barriers to SOA are much, much lower than any agile method.

I would be very interested in hearing any accounts of the SOA-Agile mix. Any thoughts would definitely be appreciated.

Also, “small-scale” SOA sounds like an interesting idea. How relevant is SOA to not-so-large systems ? As a standalone developer, I’d like to know what improvements SOA can bring me over OOA and other alternatives. I’m always looking for ways to be more productive and increase quality at the same time. TDD has recently done exactly that. Some of XP’s practices have also contributed. SOA looks promising. Its the integration of these behaviours that interests me today.

Tell me what you think !



Mistake #1

Saturday, November 29th, 2003

I haven’t yet found a mistake of mine that I want to publish, but it just so happens that I came across someone else’s ( luckily ).

On Udi Dahan’s Projects you can find information about the projects that I’ve currently got underway – 5 ( +1 that I’ll have to take on later ).

On one of the projects, Accounting System, I am charged with taking a project that’s finished development ~95% and taking it to production. The developer took me through the system, and I realized that this was not the architecture that I had envisioned when told: “This is a good system. Well architected, stored procedures, and C# code that calls it. ASP.NET pages using code-behind. Its practically finished.”

You can see what kind of monster I’ve inherited here.

To all you DBAs out there who want to develop systems, I tell you this: Do NOT put all the system into the database just because you can ! Even the dreaded “3-tier architecture” is better than that.

Just so the rest of you get an idea of what I’m talking about, think about putting all possible logic into the DB. Calling a stored procedure is all you ever do from the UI besides basic GUI event handling stuff. The SP then does everything – checks business rules, sends email, calls webservices, performs calculations – you name it.

And WHY did they do this ?! So that they could change the functionality of the system without recompiling it ! Let’s see, toss out all the *abilities ( maintainability and all the others ) , get ability to change system without recompile. Hmm… That’s like trading diamonds for glass.

Now, here’s the best part: For the project to be profitable, I’ll have to work by the same conventions ! ugghh…

Final thought: “It works” isn’t an excuse.

Well, I guess that my mistake in this whole process was assuming. Assuming that what I consider well architected, and what someone else considers well architected are two different things. Or, more generally, miscommunication. Even though I was told what to expect “Well architected, stored procedures, and C# code that calls it…”, I didn’t verify what this exactly meant. And even worse – I gave an estimate based on my assumption.

Lesson to be learned ( for me – and I’m only writing this so that I can berate myself more harshly the NEXT time it’ll happen ): Actively search for the hidden assumptions that I make when listening to someone. Make them explicit. Verify them with the speaker.

Final note: although I’ve heard this piece of advice many times before, and, like most things, is just common sense, it wasn’t REAL until it happened to me.



   


Don't miss my best content
 

Recommendations

Bryan Wheeler, Director Platform Development at msnbc.com
“Udi Dahan is the real deal.

We brought him on site to give our development staff the 5-day “Advanced Distributed System Design” training. The course profoundly changed our understanding and approach to SOA and distributed systems.

Consider some of the evidence: 1. Months later, developers still make allusions to concepts learned in the course nearly every day 2. One of our developers went home and made her husband (a developer at another company) sign up for the course at a subsequent date/venue 3. Based on what we learned, we’ve made constant improvements to our architecture that have helped us to adapt to our ever changing business domain at scale and speed If you have the opportunity to receive the training, you will make a substantial paradigm shift.

If I were to do the whole thing over again, I’d start the week by playing the clip from the Matrix where Morpheus offers Neo the choice between the red and blue pills. Once you make the intellectual leap, you’ll never look at distributed systems the same way.

Beyond the training, we were able to spend some time with Udi discussing issues unique to our business domain. Because Udi is a rare combination of a big picture thinker and a low level doer, he can quickly hone in on various issues and quickly make good (if not startling) recommendations to help solve tough technical issues.” November 11, 2010

Sam Gentile Sam Gentile, Independent WCF & SOA Expert
“Udi, one of the great minds in this area.
A man I respect immensely.”





Ian Robinson Ian Robinson, Principal Consultant at ThoughtWorks
"Your blog and articles have been enormously useful in shaping, testing and refining my own approach to delivering on SOA initiatives over the last few years. Over and against a certain 3-layer-application-architecture-blown-out-to- distributed-proportions school of SOA, your writing, steers a far more valuable course."

Shy Cohen Shy Cohen, Senior Program Manager at Microsoft
“Udi is a world renowned software architect and speaker. I met Udi at a conference that we were both speaking at, and immediately recognized his keen insight and razor-sharp intellect. Our shared passion for SOA and the advancement of its practice launched a discussion that lasted into the small hours of the night.
It was evident through that discussion that Udi is one of the most knowledgeable people in the SOA space. It was also clear why – Udi does not settle for mediocrity, and seeks to fully understand (or define) the logic and principles behind things.
Humble yet uncompromising, Udi is a pleasure to interact with.”

Glenn Block Glenn Block, Senior Program Manager - WCF at Microsoft
“I have known Udi for many years having attended his workshops and having several personal interactions including working with him when we were building our Composite Application Guidance in patterns & practices. What impresses me about Udi is his deep insight into how to address business problems through sound architecture. Backed by many years of building mission critical real world distributed systems it is no wonder that Udi is the best at what he does. When customers have deep issues with their system design, I point them Udi's way.”

Karl Wannenmacher Karl Wannenmacher, Senior Lead Expert at Frequentis AG
“I have been following Udi’s blog and podcasts since 2007. I’m convinced that he is one of the most knowledgeable and experienced people in the field of SOA, EDA and large scale systems.
Udi helped Frequentis to design a major subsystem of a large mission critical system with a nationwide deployment based on NServiceBus. It was impressive to see how he took the initial architecture and turned it upside down leading to a very flexible and scalable yet simple system without knowing the details of the business domain. I highly recommend consulting with Udi when it comes to large scale mission critical systems in any domain.”

Simon Segal Simon Segal, Independent Consultant
“Udi is one of the outstanding software development minds in the world today, his vast insights into Service Oriented Architectures and Smart Clients in particular are indeed a rare commodity. Udi is also an exceptional teacher and can help lead teams to fall into the pit of success. I would recommend Udi to anyone considering some Architecural guidance and support in their next project.”

Ohad Israeli Ohad Israeli, Chief Architect at Hewlett-Packard, Indigo Division
“When you need a man to do the job Udi is your man! No matter if you are facing near deadline deadlock or at the early stages of your development, if you have a problem Udi is the one who will probably be able to solve it, with his large experience at the industry and his widely horizons of thinking , he is always full of just in place great architectural ideas.
I am honored to have Udi as a colleague and a friend (plus having his cell phone on my speed dial).”

Ward Bell Ward Bell, VP Product Development at IdeaBlade
“Everyone will tell you how smart and knowledgable Udi is ... and they are oh-so-right. Let me add that Udi is a smart LISTENER. He's always calibrating what he has to offer with your needs and your experience ... looking for the fit. He has strongly held views ... and the ability to temper them with the nuances of the situation.
I trust Udi to tell me what I need to hear, even if I don't want to hear it, ... in a way that I can hear it. That's a rare skill to go along with his command and intelligence.”

Eli Brin, Program Manager at RISCO Group
“We hired Udi as a SOA specialist for a large scale project. The development is outsourced to India. SOA is a buzzword used almost for anything today. We wanted to understand what SOA really is, and what is the meaning and practice to develop a SOA based system.
We identified Udi as the one that can put some sense and order in our minds. We started with a private customized SOA training for the entire team in Israel. After that I had several focused sessions regarding our architecture and design.
I will summarize it simply (as he is the software simplist): We are very happy to have Udi in our project. It has a great benefit. We feel good and assured with the knowledge and practice he brings. He doesn’t talk over our heads. We assimilated nServicebus as the ESB of the project. I highly recommend you to bring Udi into your project.”

Catherine Hole Catherine Hole, Senior Project Manager at the Norwegian Health Network
“My colleagues and I have spent five interesting days with Udi - diving into the many aspects of SOA. Udi has shown impressive abilities of understanding organizational challenges, and has brought the business perspective into our way of looking at services. He has an excellent understanding of the many layers from business at the top to the technical infrstructure at the bottom. He is a great listener, and manages to simplify challenges in a way that is understandable both for developers and CEOs, and all the specialists in between.”

Yoel Arnon Yoel Arnon, MSMQ Expert
“Udi has a unique, in depth understanding of service oriented architecture and how it should be used in the real world, combined with excellent presentation skills. I think Udi should be a premier choice for a consultant or architect of distributed systems.”

Vadim Mesonzhnik, Development Project Lead at Polycom
“When we were faced with a task of creating a high performance server for a video-tele conferencing domain we decided to opt for a stateless cluster with SQL server approach. In order to confirm our decision we invited Udi.

After carefully listening for 2 hours he said: "With your kind of high availability and performance requirements you don’t want to go with stateless architecture."

One simple sentence saved us from implementing a wrong product and finding that out after years of development. No matter whether our former decisions were confirmed or altered, it gave us great confidence to move forward relying on the experience, industry best-practices and time-proven techniques that Udi shared with us.
It was a distinct pleasure and a unique opportunity to learn from someone who is among the best at what he does.”

Jack Van Hoof Jack Van Hoof, Enterprise Integration Architect at Dutch Railways
“Udi is a respected visionary on SOA and EDA, whose opinion I most of the time (if not always) highly agree with. The nice thing about Udi is that he is able to explain architectural concepts in terms of practical code-level examples.”

Neil Robbins Neil Robbins, Applications Architect at Brit Insurance
“Having followed Udi's blog and other writings for a number of years I attended Udi's two day course on 'Loosely Coupled Messaging with NServiceBus' at SkillsMatter, London.

I would strongly recommend this course to anyone with an interest in how to develop IT systems which provide immediate and future fitness for purpose. An influential and innovative thought leader and practitioner in his field, Udi demonstrates and shares a phenomenally in depth knowledge that proves his position as one of the premier experts in his field globally.

The course has enhanced my knowledge and skills in ways that I am able to immediately apply to provide benefits to my employer. Additionally though I will be able to build upon what I learned in my 2 days with Udi and have no doubt that it will only enhance my future career.

I cannot recommend Udi, and his courses, highly enough.”

Nick Malik Nick Malik, Enterprise Architect at Microsoft Corporation
“You are an excellent speaker and trainer, Udi, and I've had the fortunate experience of having attended one of your presentations. I believe that you are a knowledgable and intelligent man.”

Sean Farmar Sean Farmar, Chief Technical Architect at Candidate Manager Ltd
“Udi has provided us with guidance in system architecture and supports our implementation of NServiceBus in our core business application.

He accompanied us in all stages of our development cycle and helped us put vision into real life distributed scalable software. He brought fresh thinking, great in depth of understanding software, and ongoing support that proved as valuable and cost effective.

Udi has the unique ability to analyze the business problem and come up with a simple and elegant solution for the code and the business alike.
With Udi's attention to details, and knowledge we avoided pit falls that would cost us dearly.”

Børge Hansen Børge Hansen, Architect Advisor at Microsoft
“Udi delivered a 5 hour long workshop on SOA for aspiring architects in Norway. While keeping everyone awake and excited Udi gave us some great insights and really delivered on making complex software challenges simple. Truly the software simplist.”

Motty Cohen, SW Manager at KorenTec Technologies
“I know Udi very well from our mutual work at KorenTec. During the analysis and design of a complex, distributed C4I system - where the basic concepts of NServiceBus start to emerge - I gained a lot of "Udi's hours" so I can surely say that he is a professional, skilled architect with fresh ideas and unique perspective for solving complex architecture challenges. His ideas, concepts and parts of the artifacts are the basis of several state-of-the-art C4I systems that I was involved in their architecture design.”

Aaron Jensen Aaron Jensen, VP of Engineering at Eleutian Technology
“Awesome. Just awesome.

We’d been meaning to delve into messaging at Eleutian after multiple discussions with and blog posts from Greg Young and Udi Dahan in the past. We weren’t entirely sure where to start, how to start, what tools to use, how to use them, etc. Being able to sit in a room with Udi for an entire week while he described exactly how, why and what he does to tackle a massive enterprise system was invaluable to say the least.

We now have a much better direction and, more importantly, have the confidence we need to start introducing these powerful concepts into production at Eleutian.”

Gad Rosenthal Gad Rosenthal, Department Manager at Retalix
“A thinking person. Brought fresh and valuable ideas that helped us in architecting our product. When recommending a solution he supports it with evidence and detail so you can successfully act based on it. Udi's support "comes on all levels" - As the solution architect through to the detailed class design. Trustworthy!”

Chris Bilson Chris Bilson, Developer at Russell Investment Group
“I had the pleasure of attending a workshop Udi led at the Seattle ALT.NET conference in February 2009. I have been reading Udi's articles and listening to his podcasts for a long time and have always looked to him as a source of advice on software architecture.
When I actually met him and talked to him I was even more impressed. Not only is Udi an extremely likable person, he's got that rare gift of being able to explain complex concepts and ideas in a way that is easy to understand.
All the attendees of the workshop greatly appreciate the time he spent with us and the amazing insights into service oriented architecture he shared with us.”

Alexey Shestialtynov Alexey Shestialtynov, Senior .Net Developer at Candidate Manager
“I met Udi at Candidate Manager where he was brought in part-time as a consultant to help the company make its flagship product more scalable. For me, even after 30 years in software development, working with Udi was a great learning experience. I simply love his fresh ideas and architecture insights.
As we all know it is not enough to be armed with best tools and technologies to be successful in software - there is still human factor involved. When, as it happens, the project got in trouble, management asked Udi to step into a leadership role and bring it back on track. This he did in the span of a month. I can only wish that things had been done this way from the very beginning.
I look forward to working with Udi again in the future.”

Christopher Bennage Christopher Bennage, President at Blue Spire Consulting, Inc.
“My company was hired to be the primary development team for a large scale and highly distributed application. Since these are not necessarily everyday requirements, we wanted to bring in some additional expertise. We chose Udi because of his blogging, podcasting, and speaking. We asked him to to review our architectural strategy as well as the overall viability of project.
I was very impressed, as Udi demonstrated a broad understanding of the sorts of problems we would face. His advice was honest and unbiased and very pragmatic. Whenever I questioned him on particular points, he was able to backup his opinion with real life examples. I was also impressed with his clarity and precision. He was very careful to untangle the meaning of words that might be overloaded or otherwise confusing. While Udi's hourly rate may not be the cheapest, the ROI is undoubtedly a deal. I would highly recommend consulting with Udi.”

Robert Lewkovich, Product / Development Manager at Eggs Overnight
“Udi's advice and consulting were a huge time saver for the project I'm responsible for. The $ spent were well worth it and provided me with a more complete understanding of nServiceBus and most importantly in helping make the correct architectural decisions earlier thereby reducing later, and more expensive, rework.”

Ray Houston Ray Houston, Director of Development at TOPAZ Technologies
“Udi's SOA class made me smart - it was awesome.

The class was very well put together. The materials were clear and concise and Udi did a fantastic job presenting it. It was a good mixture of lecture, coding, and question and answer. I fully expected that I would be taking notes like crazy, but it was so well laid out that the only thing I wrote down the entire course was what I wanted for lunch. Udi provided us with all the lecture materials and everyone has access to all of the samples which are in the nServiceBus trunk.

Now I know why Udi is the "Software Simplist." I was amazed to find that all the code and solutions were indeed very simple. The patterns that Udi presented keep things simple by isolating complexity so that it doesn't creep into your day to day code. The domain code looks the same if it's running in a single process or if it's running in 100 processes.”

Ian Cooper Ian Cooper, Team Lead at Beazley
“Udi is one of the leaders in the .Net development community, one of the truly smart guys who do not just get best architectural practice well enough to educate others but drives innovation. Udi consistently challenges my thinking in ways that make me better at what I do.”

Liron Levy, Team Leader at Rafael
“I've met Udi when I worked as a team leader in Rafael. One of the most senior managers there knew Udi because he was doing superb architecture job in another Rafael project and he recommended bringing him on board to help the project I was leading.
Udi brought with him fresh solutions and invaluable deep architecture insights. He is an authority on SOA (service oriented architecture) and this was a tremendous help in our project.
On the personal level - Udi is a great communicator and can persuade even the most difficult audiences (I was part of such an audience myself..) by bringing sound explanations that draw on his extensive knowledge in the software business. Working with Udi was a great learning experience for me, and I'll be happy to work with him again in the future.”

Adam Dymitruk Adam Dymitruk, Director of IT at Apara Systems
“I met Udi for the first time at DevTeach in Montreal back in early 2007. While Udi is usually involved in SOA subjects, his knowledge spans all of a software development company's concerns. I would not hesitate to recommend Udi for any company that needs excellent leadership, mentoring, problem solving, application of patterns, implementation of methodologies and straight out solution development.
There are very few people in the world that are as dedicated to their craft as Udi is to his. At ALT.NET Seattle, Udi explained many core ideas about SOA. The team that I brought with me found his workshop and other talks the highlight of the event and provided the most value to us and our organization. I am thrilled to have the opportunity to recommend him.”

Eytan Michaeli Eytan Michaeli, CTO Korentec
“Udi was responsible for a major project in the company, and as a chief architect designed a complex multi server C4I system with many innovations and excellent performance.”


Carl Kenne Carl Kenne, .Net Consultant at Dotway AB
“Udi's session "DDD in Enterprise apps" was truly an eye opener. Udi has a great ability to explain complex enterprise designs in a very comprehensive and inspiring way. I've seen several sessions on both DDD and SOA in the past, but Udi puts it in a completly new perspective and makes us understand what it's all really about. If you ever have a chance to see any of Udi's sessions in the future, take it!”

Avi Nehama, R&D Project Manager at Retalix
“Not only that Udi is a briliant software architecture consultant, he also has remarkable abilities to present complex ideas in a simple and concise manner, and...
always with a smile. Udi is indeed a top-league professional!”

Ben Scheirman Ben Scheirman, Lead Developer at CenterPoint Energy
“Udi is one of those rare people who not only deeply understands SOA and domain driven design, but also eloquently conveys that in an easy to grasp way. He is patient, polite, and easy to talk to. I'm extremely glad I came to his workshop on SOA.”

Scott C. Reynolds Scott C. Reynolds, Director of Software Engineering at CBLPath
“Udi is consistently advancing the state of thought in software architecture, service orientation, and domain modeling.
His mastery of the technologies and techniques is second to none, but he pairs that with a singular ability to listen and communicate effectively with all parties, technical and non, to help people arrive at context-appropriate solutions. Every time I have worked with Udi, or attended a talk of his, or just had a conversation with him I have come away from it enriched with new understanding about the ideas discussed.”

Evgeny-Hen Osipow, Head of R&D at PCLine
“Udi has helped PCLine on projects by implementing architectural blueprints demonstrating the value of simple design and code.”

Rhys Campbell Rhys Campbell, Owner at Artemis West
“For many years I have been following the works of Udi. His explanation of often complex design and architectural concepts are so cleanly broken down that even the most junior of architects can begin to understand these concepts. These concepts however tend to typify the "real world" problems we face daily so even the most experienced software expert will find himself in an "Aha!" moment when following Udi teachings.
It was a pleasure to finally meet Udi in Seattle Alt.Net OpenSpaces 2008, where I was pleasantly surprised at how down-to-earth and approachable he was. His depth and breadth of software knowledge also became apparent when discussion with his peers quickly dove deep in to the problems we current face. If given the opportunity to work with or recommend Udi I would quickly take that chance. When I think .Net Architecture, I think Udi.”

Sverre Hundeide Sverre Hundeide, Senior Consultant at Objectware
“Udi had been hired to present the third LEAP master class in Oslo. He is an well known international expert on enterprise software architecture and design, and is the author of the open source messaging framework nServiceBus. The entire class was based on discussion and interaction with the audience, and the only Power Point slide used was the one showing the agenda.
He started out with sketching a naive traditional n-tier application (big ball of mud), and based on suggestions from the audience we explored different solutions which might improve the solution. Whatever suggestions we threw at him, he always had a thoroughly considered answer describing pros and cons with the suggested solution. He obviously has a lot of experience with real world enterprise SOA applications.”

Raphaël Wouters Raphaël Wouters, Owner/Managing Partner at Medinternals
“I attended Udi's excellent course 'Advanced Distributed System Design with SOA and DDD' at Skillsmatter. Few people can truly claim such a high skill and expertise level, present it using a pragmatic, concrete no-nonsense approach and still stay reachable.”

Nimrod Peleg Nimrod Peleg, Lab Engineer at Technion IIT
“One of the best programmers and software engineer I've ever met, creative, knows how to design and implemet, very collaborative and finally - the applications he designed implemeted work for many years without any problems!”

Jose Manuel Beas
“When I attended Udi's SOA Workshop, then it suddenly changed my view of what Service Oriented Architectures were all about. Udi explained complex concepts very clearly and created a very productive discussion environment where all the attendees could learn a lot. I strongly recommend hiring Udi.”

Daniel Jin Daniel Jin, Senior Lead Developer at PJM Interconnection
“Udi is one of the top SOA guru in the .NET space. He is always eager to help others by sharing his knowledge and experiences. His blog articles often offer deep insights and is a invaluable resource. I highly recommend him.”

Pasi Taive Pasi Taive, Chief Architect at Tieto
“I attended both of Udi's "UI Composition Key to SOA Success" and "DDD in Enterprise Apps" sessions and they were exceptionally good. I will definitely participate in his sessions again. Udi is a great presenter and has the ability to explain complex issues in a manner that everyone understands.”

Eran Sagi, Software Architect at HP
“So far, I heard about Service Oriented architecture all over. Everyone mentions it – the big buzz word. But, when I actually asked someone for what does it really mean, no one managed to give me a complete satisfied answer. Finally in his excellent course “Advanced Distributed Systems”, I got the answers I was looking for. Udi went over the different motivations (principles) of Services Oriented, explained them well one by one, and showed how each one could be technically addressed using NService bus. In his course, Udi also explain the way of thinking when coming to design a Service Oriented system. What are the questions you need to ask yourself in order to shape your system, place the logic in the right places for best Service Oriented system.

I would recommend this course for any architect or developer who deals with distributed system, but not only. In my work we do not have a real distributed system, but one PC which host both the UI application and the different services inside, all communicating via WCF. I found that many of the architecture principles and motivations of SOA apply for our system as well. Enough that you have SW partitioned into components and most of the principles becomes relevant to you as well. Bottom line – an excellent course recommended to any SW Architect, or any developer dealing with distributed system.”

Consult with Udi

Guest Authored Books



Creative Commons License  © Copyright 2005-2011, Udi Dahan. email@UdiDahan.com