Service Oriented Architecture, why my boss should let me use CSLA!

Service Oriented Architecture, why my boss should let me use CSLA!

Old forum URL: forums.lhotka.net/forums/t/5068.aspx


Plowking posted on Tuesday, July 08, 2008

Hi

I have developed a beautiful application to manage data for several customers. I say its beautiful because it uses CSLA.

My boss wants both a web service UI and a Web App UI. He wants to build the Web App UI on top of the WS UI. I have told him we should build the Web App UI directly on the CSLA business objects, and do the same with the WS, but he disagrees, strongly.

In the first version of the application it will only be used to edit Customers data through the Web UI, and there will only be one installation of the application. The WS would allow 3rd parties to build an application based on our data. My boss also wants us to use the WS UI.

If the application were installed with clients the data should also be editable, and perhaps avaliable to a 3rd party via WS's, but again here I have suggested installing our Web UI on the same web server as the Web Service to administer the data, instead of building it on top the the WS.

The basis for my decision is of course that I want direct access to my CSLA objects for all the smart functionality they give me, validation, authorisation, n level undo etc, but I cant convince my boss.

I have told him that if we created a Web Application that gives the same user experience based on web services, all the business rules will probably need to be duplicated in the Web app in some way, and in fact that this would best be achieved by using CSLA! I dont fancy recreating my Business Objects so that they use WS's in there CRUD methods, and doubt my boss would let me anyway.

My boss WANTS the application to be an SOA, but cannot justify it to me. He just says he wants the WS on one server and the Web App on another.

Am I right that we do not need a WS layer in this simple Web App? and how can I better justify it to my boss.

Zafar Ullah replied on Tuesday, July 08, 2008

Plowking,

After reading all details i just want to clear the need of SOA, then may be you or your boss can decide what best suites your need.

1. In your situation SOA suites best if your appliaction wants to expose its services for third party implementations i.e people use your services and build there own Customers data front end etc.

2. For marketing purpose its more attrictive for clients that appliation is 3 tier and WS based.

My Recmendations:

--------------------

Write all your business logic independent of calling enviorment and expose there interfaces to clients. Now call these methods from any where you want. expose WS so that others may get them in any application Web/Mobile/Winforms/Java etc while write seprate dll (which call actual business logic) that your app use . Remember use [RunLocal] attribute when you write calling methods for your app so that network calls wont go as in case of WS.

Plowking replied on Friday, July 11, 2008

Hi Zafar

Thanks for your feedback. In response to your points

1. It is possible that third parties may require access to our application in future as via a web service. A web service interface has already implemented.

2. I agree here, marketing is what is on my bosses mind too.

All of my business logic is encapsulated in my CSLA classes, and I have built a WS interface which simply maps dumb data containers to my business objects and returns the property data.

Where I differ in opinion with my boss is that for our own web application, which allows both us and 3rd parties to edit their data, it is not necessary for us to build on a WS, when we have direct access to our CSLA business objects. This gives us all the advantages of building upon smart CSLA business objects instead of the dumb data containers returned by web services. This means we would save the duplication  business logic in the Web App which would require extra maintenence to  keep it in sync with the business logic in the WS. It also means I can use databinding, n-level undo and all the other smart CSLA trickery to make an advanced Web UI quickly and reliably.

vdhant replied on Friday, July 11, 2008

Hi Plowking
I would tend to agree with you... I would recommending to my boss to that we program directly against the CSLA. This will allow your web application to be interactive, responsive and maintainable than any other applications using your public services. Thus giving your application a competitive advantage.

The only reason that reason (besides being pig headed) why your boss could be making you use the services as well, is because he wants to sell to people the concept "use our services there great... even we use our services to build our own kick ass application...". Or he wants you to use it so that you have direct experience using it, can help others use it because you have to use it, and also see pain points before others using the services do.

If he was making you do this because he wants to host the web app on a different box to the web services, i don't think that this is a valid augment. You can just use the same business objects dlls on the two servers and when you do updates, you just update both sets of dlls. I don’t see this as a problem as if you are using same clients you have this same problem currently (i.e. multiple copies of your dlls around the place in each client). So you could have both apps (the web app and the services) on two different servers both talking directly to the CSLA objects and going back to the same data source. Thus if this is his thinking i don’t think it is a valid point.

One thing to remember though is that you are not the first person to be told to use the services instead of the dlls. I am pretty sure that the various components of Team Foundation Server its self use the service interface and not the dlls to talk to the central warehouse. They could use the dlls directly and achive the same results but they use the services. Why i'm not sure... But i remember reading this a while ago and i think it had something to do with the abstraction model they wanted to use or something like that, although i dont think that this would be the case for you.

Hope this helps.
Anthony

Copyright (c) Marimer LLC