Search |
||
Tier-less computing further explainedPosted by satyak on July 17, 2004 at 1:52 AM PDT
Let us start with a need Given a user name, userid and an email address create a user. We can call this "createUser" transaction with three parameters name, id, and email. Let us see how a client can invoke this horizontally Conceptual horizontal invocation using key value pairs
For example this is how a web browser will invoke a transaction. The equivalnet programmatic invocation will be
Let us see how we can provide an implementation using horizontal parts
Purists will quickly point out that CreateUser can be more complex. Well Horizontal parts can still solve the problem pretty decently a good number of times. Let us attempt it.
So we used a transactional pipeline to do the job Let use solve it using a vertical part Unconvinced purists still nod their heads horizontally. So we now proceed to solve the problem using an unfettered java class
Now change the config file to
No addtional configuration entries are required How can we run CreateUser on a remote computer?
The magic of invoking the transaction is carried out by an implementation of IFactory. So the factory itself is bootstrapped using its own features allowing us to replace various implementations for it. We can go from a simple factory to filtered factory to IOCFactory to a DelegateEnabledFactory. Assuming we are using the last this is what it does. It checks to see if there are any delegates that can handle the "CreateUser", if there is it hands over the request to them. In this case there is a delegate called "RemoteDelegate" that is configured to handle "CreateUser". That is how "CreateUser" is transferred to a remote machine. If we don't want this, just delete the "createuser" from that delegate's list. Why is this tier-less computing Because by flipping a switch we are able to run CreateUser on a different box other than the local. Development can take place with this switch set to local and deployment can use static or dynamic strategies to deploy these components References 1. General Introduction to other Server side Patterns in this series »
Related Topics >>
Java Patterns Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|