c# - Create wrapper to hide implementation details for data structures -


I have some integration (such as salesforce) that I would like to hide behind a product-an agnostic cover (rather than a CRMsige class) Salesforce service category).

It seems quite easy that I can only create a CRmService class and use the SalesforceService class as an implementation description in the CRmService, however, there is a problem Salesforce service offers some exceptions and anomes Uses it would be strange if my CRMServa threw the Salesforce exception or you needed to use the Salesforce anman.

How can I complete any thoughts that I want right?

EDIT: Currently, I'm holding Salesforce and throwing my own custom for exceptions, I'm not sure what though I should do for enums though. I think I can map my own providers-Wikipedia staff, but I'm looking for a common solution that can be cleaner than doing this mapping. If this is my only option (to map them), then it is fine, just trying to get ideas.

In short, the answer is that you are on the right track, have read through.

The fundamental assumption is that should accept the given object

The advantage of following a demeter's law is that, the structure of anything or As much as possible, with the attribute (including its subsets) , it is possible

The resulting software is more suitable and adaptable because the object is on the internal structure of other objects Less dependent, the object container will double your callers again Can be changed without taking it.

Although it may have too many cover methods to write the promotion of calls for components; In some cases, it can add noticeable time and place overhead.

So you see that you are following a very good practice which I usually follow myself but try some effort.

And yes, you have to catch the request and responses to your exception and catch, there are many attempts, but if you have to change the sales force in a few years then you will be considered a hero.

All things, along with the software development, should you try to benefit from profit, if you think you have never changed salesforce? So is it really necessary? ... you have to decide for yourself.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -