Register or Login to Your Account
1). I need suggestions, if we are developing a service by using try and catch block....we are writing code in try block. Instead of writing that code in the try block code has to be maintain in separate service and that service has to be call in try block....is there any benefit by calling that service in try block instead of writing code directly in the try block.
2). if we have a benefit by doing like the above scenario how i will develop the service by using try and catch block. it should be common to all service codes....that means it should be like common service framework.
Example: I have to develop one common scenario to all the codes by using try block and catch block. if any other members developed one service simply they have to call that service in try block. if they develop another service code they have to call that service in try block. code may be varied but the service which i have to develop must be the same to all codes.
Please suggest in the above scenarios....i am looking for quick responses and good suggestions.
Yes, there are benefits for writing the code apart from the try block and it depends on many scenarios.
1) For each and every functionality, business or technical would be written in a separate service.
2) Here if you have a service A where you implement try and catch and you call service B in it which does not have try and catch implementation means for an error at service B service A would be doing the error handling part, it may store the errors in db or write to logs or send an email alert. Here other child steps in Service A would not be implemented if an error occurred.
3) If in Service A we have try and catch and in service B also implementing try and catch and handling error means after error handling the control come to service A, which can execute the other child steps like C and D if it has.
Thank you very much rajkumar for the information......... :)