Checkout PlaceOrder function review

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi,

Out of my curiosity, I just investigate a little bit into the Checkout Process in nopCommerce V1.4 this couple days,
I realized the function for InsertOrder or UpdateOrder. at this time, these couple function got heaps of parameters to pass.

this is not a issue at all, however, since it is N-Tier structure, you can find the same function with also heaps of parameter in Nop.DataAccess, Nop.DataAccess.SqlServer and Nop.BusinessLogic. totally it gonna be at least 3 places for every function of InsertOrder/UpdateOrder.

I am wondering why not make the parameters as Object for instance, DBOrder or Order. otherwise it is really frustrating to pass through such heaps of parameter. isn't it?

Any idea with it?


Regards
Dave
14 anos atrás
Anyway i am gonna try to do some amendments for the function of PlaceOrder

at least change the parameters into Object and make it elegant eventually.

Cheers
Dave
14 anos atrás
This is my preference also as it minimises the changes you have to make should new properties be added to your domain objects.

I would typically have the DAL classes taking in DBObjects as parameters and the business manager methods taking in domain objects as parameters e.g. Order and mapping these to the data layer objects.

Really I would like to see nopCommerce use the repository pattern as the DBObjects are a bit pointless in my opinion - but thats a discussion for another day :)
14 anos atrás
nopCommerce team | retroviz wrote:
This is my preference also as it minimises the changes you have to make should new properties be added to your domain objects.


I don't agree it will minimize the changes you have to make. on the contrary, it could minimize the changes if you use object and also it is appropriate with the OOP philosophy.

Cheers
Dave
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.