Thursday, May 17, 2007

Finally free!

At last!, finally after missing the original deadline by quite a large margin, I have managed to complete a small independent system for receiving paypal and google notifications.

currently its undergoing testing, but it has been really exciting to develop it, on recieving the information from paypal / google we can traverse the information and create user accounts and place orders for our system automaticlly, hopefully this will take quite a burden off the operations team.

It was a fun challange to design a generic set of business classes that could satisfy the information needs for our system (we have an ecommerce shopping site) , information returned by google, and information returned by paypal, Although i can still think of a few improvements here and there but for the moment the model will suffice and should be expandable by implementing another checkout system with little modification.

I will post the architecture that I have tried to use for comments from others. Designing a system that is generic enough to be loosely coupled and integrates with the legacy code (by legacy I mean ASP 3 and COM+) has its share of design issues. lets have a look at the model:


Level 1 implementation


Level 2 implementation

There are 2 levels of implementation, the first level implementation requires to deliver the information form our website to paypal and google checkout.

As you can see, the first level implementation consists of an independant .net 2.0 assembly, registered as COM. This assembly consists of all the core business classes and supporting utility classes. This assembly has a set of core classes that accept xml (based on our own schema for information) as input and product respective html button code through a factory method. Along the way while parsing and validating the xml it also populates the business objects that can be used sometime later in the application development lifetime.

The level 2 implementation is concerned with implementing a notification service, that is able to receive notifications from both paypal ipn and google notification API, although a single landing page is possible but it would create a tightly coupled integration and would be difficult to maintain and expand to another checkout provider if it came along.

NotificationListener is a single web app but with 2 entry points, once for the google notification serivice and the other for paypal. These are just simple asp.net 2.0 pages that use the business classes generated earlier in CheckoutProvider.dll.

NotificationListener also implement microsoft enterprise library 3.0, which again i have to say save d a lot of coding effort and debugging, I used it for logging and exception logging. It has a pretty good structure and relatively quite easy to implement

the only place where i couldnt force loose coupling with the legacy application was the data layer, since all the information has to go in the same database as the actual commerce site, I believe that it can be worked out into an independent component with a little effort and its own database. but given the time constraints that wouldnt be possible anytime soon, plus if its written as an independent component there would have to be some sort of middle ware in between to connect it to existing applications.

I'm focusing on designing reusable and maintainable components , I'd love to work on a truly SOA based application but not quite there yet, but this is a start anyway... would love to hear comments about it.

In my next post i'll also discuss an idea that I have implemented in this implementation, about implementing the save/retrieve logic right inside the business entity object... this approach has a number of flaws which I'll comment on later...


No comments: