Demandware MVC concept

大憨熊 提交于 2020-01-23 05:50:05

问题


I am new guy to Demandware and I am switching from Magento to Demandware. Demandware is not opensource I am not getting proper tutorials, stuff to understand the concepts of it.

I am from Magento so I know the Magento MVC structure. But in Demandware we have different concepts like pipelines, pipelets, ISML scripts, ECMA script, DW scripts etc.

I want to know the MVC pattern of Demandware. How it works and what are the basic concept I need to concentrate?


回答1:


I would suggest to request a Demandware XChange account as soon as possible for you, so that you get access to the Demandware community portal and also to the API documentation.

In short:

  1. Models are Demandware Forms and Demandware API objects
  2. Controllers are Demandware Pipelines (there are JavaScript Controllers that are recently released, you may find these easier to understand if you have Node.js experience). These can call DW Scripts (DemandwareScript is based on ECMAScript standard 5.0 for JavaScript with some extensions like E4X and optional types)
  3. Views are the isml templates. You should avoid including a lot of logic in them, either with isml tags like isif, isloop, etc. or with isscript.

Any further questions - let me know.

Hope this helps,

Zlatin




回答2:


I hope you'll be able to avoid pipelines and dwscript. Those are a bit older. The most recent version works with plain old JavaScript, with pipelines being replaced by controllers.

Be aware that the underlying JavaScript engine is Rhino, which isn't really modern.




回答3:


Demandware is very much designed around the MVC concept (in theory). The pipelines are basically your controllers and each pipeline filename (the xml file) is the first part of the URL and the start nodes inside the pipeline are the second part of the URL that basically represent the controller (eg Cart.xml has a start node called Show, so the url is Cart-Show). At the end of the pipeline flow chart is, usually, an interaction node to that links to an ISML file, those are basically the View and are HTML with some minor Demandware-specific markup.

Typically in the MVC world you try to prevent putting business logic in the views, however if you use SiteGenesis as your starting point you'll find that not to be the case on most of the pages. If you switch to using Javascript Controllers instead of Pipelines, then it'll be closer to the Magento style of MVC (but using NodeJS-like syntax).




回答4:


The Demandware documentation is open source now anyone can access to without having an exchange account it has the latest SFRA(javascript) based concepts as well here is the link for the docs Demadware Documentation



来源:https://stackoverflow.com/questions/37111474/demandware-mvc-concept

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!