Your SlideShare is downloading. ×
Occ   tech for commerce
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Occ tech for commerce

195
views

Published on

Published in: Technology, Business

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
195
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Omni Commerce: From Buzzword to Technology 
 Jürgen Albertsen Enterprise Architect hybris
  • 2. Commerce is Everywhere TV Console Web POS Mobile Call Center Social Print Digital Ads Marketplace Mobile Native
  • 3. A Few Examples TV Mobile + + = Live stream, shop as you watch Mobile + = Want this, alert me when near shop Product Product Checkout Location POS + = Not available in store, deliver to home Product Checkout
  • 4. We call it Multi Channel
  • 5. No, Omni Channel
  • 6. No, Omni Commerce
  • 7. Nice word but: How to do it?
  • 8. The solution: Web Services of course
  • 9. The Problem: hybris is pretty old mature
  • 10. Core Services Core / Jalo Over theYears We Stacked up Quite a Stack Commerce Services Commerce Façades Accelerator (Web Storefront) OCC (Web Services)
  • 11. Let’s Zoom In Controller Converter Service Façade DTO Model Populator
  • 12. A DTO public class CartData implements Serializable { ! private String code; private boolean net; private PriceData totalPrice; //... public String getCode() { return code; } public void setCode(String code) { this.code = code; } ! //... }
  • 13. A Descriptor for DTOs <bean class="de.hybris.platform.commercefacades.order.CartData"> <property name="code" type="String"/> <property name="net" type="boolean"/> <property name="totalPrice" type="de.hybris.platform.commercefacades.product.PriceData"/> <!-- ... --> </bean>
  • 14. A Façade public interface CartFacade { ! CartData getSessionCart(); ! CartData getMiniCart(); ! CartModificationData addToCart(String code, long quantity) throws CommerceCartModificationException; ! // ... ! }
  • 15. A Controller for the Storefront @Controller public class AddToCartController extends AbstractController { @Resource(name = "cartFacade") private CartFacade cartFacade; ! @RequestMapping(value = "/cart/add", method = RequestMethod.POST) public String addToCart(@RequestParam("productCodePost") String code, Model model, @Valid AddToCartForm form, BindingResult bindingErrors) { // ... CartModificationData cartModification = cartFacade.addToCart(code, qty); if (cartModification.getQuantityAdded() == 0L) { model.addAttribute(ERROR_MSG_TYPE, "basket.information.quantity.noItemsAdded." + cartModification.getStatusCode()); } else if (cartModification.getQuantityAdded() < qty) { model.addAttribute(ERROR_MSG_TYPE, "basket.information.quantity.reducedNumberOfItemsAdded." + cartModification.getStatusCode()); } // .. } }
  • 16. Spring MVC doesn’t care if it’s HTML, XML, JSON, 
 or whatever
  • 17. Another Controller — this Time for a Web Service @Controller public class CartController extends BaseController { @Resource(name = "cartFacade") private CartFacade cartFacade; ! @RequestMapping(value = "/entry", method = RequestMethod.POST) @ResponseBody public CartModificationData addToCart(@RequestParam(required = true) String code, @RequestParam(required = false, defaultValue = "1") long qty) throws CommerceCartModificationException { return cartFacade.addToCart(code, qty); } ! }
  • 18. Marshal Response DTOs to XML/JSON <!-- from springmvc-servlet.xml --> ! <mvc:annotation-driven> <mvc:message-converters register-defaults="false"> <bean parent="resolverXStreamJSONConverter"/> <bean parent="resolverXStreamXmlConverter"/> </mvc:message-converters> </mvc:annotation-driven>
  • 19. We expose 
 commerce logic 
 and data model 1:1
  • 20. What Else? REST-like ETag OAuth 2.0 & HTTPS Template Shipped as source
  • 21. Questions? Beer?