25.09.2008

Orchestration with WS and COM+

In my little world i think that every software have ability to talk with every software if needs. Nowadays technology and products can make your software have this ability. The technology nowadays changes so fast that you can not catch unless you are tech. evangelist. The needs for our jobs are really hard to catch but if you have little knowledge of web services, xml and com+ you can make your world more easier.
In this post i will talk about how you can apply message routing pattern.

Think about a world that every one has it's own programming language that the other does not know. In our sofware world luckily, every programming language has primitive data types like int,float,string and how it implements it does not care us but they know and can understand. This makes me to design a web service that takes parameters with types of primitive and returns a primitive type.

[WebMethod]
Some people designs web services like T Function (K,L,M)
If i see a web service like that i can kill the person who designs and implements it. Cause lot's of types and parameters means that this service probably will suck when the customers' needs change and this means other companies poor programmers will rewrite their softare . If the programmer that is the owner of the WS. writes an another Web method, this time same functionality will be done by another Web Method and this makes coders world hard to understand it. Probably you will get an email that "heyy your wsdl document says that you have two methods of GetCustomer the one is takes a parameter of Order and the other one does not. Please tell me how i'will implement it".
My question now is changed to heyy i've got a web method that takes a enum. Who knows enum and which language can understands it. PHP ? Java ? these languages do not know enums. This again sucks.

I always design my web services that has only one method, name is call and takes two parameters of type string and has a return type of string.

string call(string uri,string strXml)

this type of web method can be called by every language. They don't need to know enums, Orders, Customers, they only have to know type of char array that is the type string.


This type of design in the future makes you to apply the message routing pattern.
Lets look at the scenario below




That's the design that 100% will suck!!. (I saw it really sucked!!).

Let's begin VB Applications integration api, it must have every web service proxy class that it needs. What a mess!! The others have this prerequirement less or equal . Two months later the architecture of the Web services said that i will change the functions of the web service that saves customers' will take more than one parameter and this will be variable sometimes people set this parameter to null sometimes can not. For example social security number. Opps the other software that use these services have to rewrite their codes again forcibly.

What i said that before write your services like

string call(string uri,string strXml)

the uri something is like montoya:customer:operations:save that defines the function and
the other parameter is would be an xml formatted string that represents the function parameters



if the customers that are from turkey have to send a property name TCKN (like social security number) i do not need to change my web service interface and inform others. What i have to do is handling in Web Service implementation. The xml format probably is understood.

In your organization if you give your web methods name same in the future you can have a server that routes the messages to web services. This feautere gives you ability of maintaining and the power of centrilization. The architecture of your future organization probably will be like this.






Lets look at these two web services' implementations that has the same signature.






The COM+ API that VB applications use



(This implementation converts COM+ API to router you can write the same method for router ws)

As a result one web service proxy class will be known that is string call(string,string) and
the xml format have to be known of the ws how process the xml message.

to my little bizilye...

Hiç yorum yok: