Wildhoney / Magento-on-Angular

Angular.js application using Magento as the backend API
360 stars 120 forks source link

Abstracted Magento backend provider #67

Closed aonic closed 10 years ago

aonic commented 10 years ago

Laravel controller do not reference Magento directly, all Magento interactions in Magento API Provider

Wildhoney commented 10 years ago

:+1: However, my only concern with this is that we now have the MagentoProvider class which has a lot of responsibilities – and even more to come.

What do you think about separting the MagentoProvider class into sub-classes for products, basket, account, et cetera...?

aonic commented 10 years ago

For the IoC to work the way it is, a single Provider implementation needs to be defined for the ecommerce platform with all the functions implemented as required by the interface.

However, the Provider implementation can reference any other classes to execute the implementations of those functions. (example: using a REST API to something like Shopify)

The only way I can picture this change now is if the MagentoProvider.php had things like this:

function getCartItems() {
    return $this->cart->getItems();
}

Thoughts?

Wildhoney commented 10 years ago

I think let's leave it for the time being and merge it in, but can you open a separate ticket to consider this in the future please?

Wildhoney commented 10 years ago

Thanks :+1: And more great work! I'll try and implement the login and registration after football.

aonic commented 10 years ago

:+1: