We have several applications that have services. These services are primaraly made for use from external developers.
We are now creating a scheduler application. Here you setup tasks that call services in multiple applications.
Some of the applications already contact each other. So there are peaces of integration between them.
The primary purpose of the scheduler application is integration between the applications. The scheduler application should be able to run tasks just like windows scheduler. In time - many different tasks will be developed. A task can call multiple services in multiple applications - but also just one.
Sometimes we would be able to re-use some of the integration already existing between the applications. But I'm not sure it is a good idea.
Here is an example with 3 applications.
1. ERP Application (ERP)
2. CRM Application (CRM)
3. Scheduler Application (the new one I'm making)
I have created some methods to illustrate the issue below. Entries are written to a CRM app and another type of entry is created in an ERP app. The entry that is create in the Erp app holds an Id of the newly created entry from the crm app)
Crm.Crea****trysLocallyAndCrea****trysInErp (Entry entries)
This method calls the local Crea****trysLocally and Erp.Crea****trysLocally. The Crea****trysLocallyAndCrea****trysInErp method holds some compensating programming that handles clean-up if the last call fails. We cannot use transactions between the applications. So I do not gain any transaction support.
Now I'm creating a scheduler application. I want a task to (amongst other things) create an entry in both applications. The question now is. Do I use the Api for each application or do I call the Crm.Crea****tryLocallyAndCrea****tryInErp method. The Tenets of service orientation state that services should be Autonomous. Would this violate this tenet.
The Crm.Crea****tryLocallyAndCrea****tryInErp method does hold some programming that I would have to do again. It also saves a little network trafic since I would need to first get the ids of the newly created entries in the CRM system and then add them to new entries which I would then create in the ERP system.
The same task might require that I call the ERP application 10 times anyway - because the integration through the CRM application might not be enough to perform the task. I would just call Crm.Crea****tryLocallyAndCrea****tryInErp to save a some programming. If I do not call it one could reason that I would be making the same programming in 2 places - and thereby possibly getting issues with needing to correct things several places.
Should I make a clean break between the scheduler application and call things diretly in each app, or should I utilize methods like Crm.Crea****tryLocallyAndCrea****tryInErp - or should I even try to focus more on building methods like Crm.Crea****tryLocallyAndCrea****tryInErp so I can also provide this fuctionallity in the applications APIs.
I hope someone has some input on this because I'm having a bit of difficulty in seeing clearly here.