You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This API is needlessly difficult to use. It lacks a coherent abstraction for what it is actually doing. Ideally, this API would work like the following:
Gateway is responsible for processing requests. Client is responsible for providing builders for all of the request types and for sending authenticated requests to Gateway. The Response objects should provide straightforward access to the results by encapsulating their underlying objects rather than the obnoxious layers that we have to try to wrap our heads around now. Objects like Expiration provide more convenient and intuitive abstractions for things like the expiration date with methods like setMonth(int month) and setYear(int year) or similar constructors like Expiration(int month, int year). As a bonus, these kinds of objects can provide early validation to inform users when the data they've entered makes no sense.
Not only will this type of straightforward abstraction be easier for users to work with, but it should also be easier for you to maintain. I'm considering doing some of this work for you since I don't want to put the code I've written against your current API into production because of how hard it is to read and understand.
Also, you SHOULD NOT provide examples of embedding this kind of code into JSPs since that represents a severe violation of the Separation of Concerns. JSPs should only contain presentation logic and should delegate this kind of work to Servlets which should delegate it to Services which bear responsibility for the business logic.
The text was updated successfully, but these errors were encountered:
Please refer to the ChargeCreditCard sample code.
Note that we have simplified the way of creating request, there has been re-design in sdks and we are deprecating the older design (classes)
Closed, re-design of the sdk was done to Controllers & Contract based design, and we are in process of deprecating the older version which was referred in this issue.
This API is needlessly difficult to use. It lacks a coherent abstraction for what it is actually doing. Ideally, this API would work like the following:
Gateway is responsible for processing requests. Client is responsible for providing builders for all of the request types and for sending authenticated requests to Gateway. The Response objects should provide straightforward access to the results by encapsulating their underlying objects rather than the obnoxious layers that we have to try to wrap our heads around now. Objects like Expiration provide more convenient and intuitive abstractions for things like the expiration date with methods like
setMonth(int month)
andsetYear(int year)
or similar constructors likeExpiration(int month, int year)
. As a bonus, these kinds of objects can provide early validation to inform users when the data they've entered makes no sense.Not only will this type of straightforward abstraction be easier for users to work with, but it should also be easier for you to maintain. I'm considering doing some of this work for you since I don't want to put the code I've written against your current API into production because of how hard it is to read and understand.
Also, you SHOULD NOT provide examples of embedding this kind of code into JSPs since that represents a severe violation of the Separation of Concerns. JSPs should only contain presentation logic and should delegate this kind of work to Servlets which should delegate it to Services which bear responsibility for the business logic.
The text was updated successfully, but these errors were encountered: