3 ms·
hi this sounds very interesting can you give more info about your setup i never liked JSF/Sruts/Tiles
by umen 16y ago
hi
this sounds very interesting can you give more info about your
setup
i never liked JSF/Sruts/Tiles
- kls 16y agoIt is actually pretty easy, If I am doing a multi-page site, I tend to use a CMS to do all of my static page templating and export them out as static pages onto the webserver. Then any dynamic stuff I build as widgets with either Dojo or jQuery depending on how complex the site it. Both toolkits have API's for calling JSON services and building UI widgets, but Dojo provides a more robust API for developing complex applications. I usually create a Javascript file per-page that is outside of the frameworks that I call "pagename"_controller.js I put all of the controller code in this file and general make it procedural. So this file will put widgets on the page, glue communication between widgets, and generally act as the view controller for that page. The controllers as wells as the server side services, I generally develop internally, because they require the most application knowledge. But if it is a huge product, I usually define the requirements for the widgets and sub them out. The nice part is in the end, the pages are pure HTML, CSS and all of the Javascript is external to the HTML and CSS so it allows the designers to work in a pure technology that they are comfortable with. It also allows me to sub out work very easily because all of the technologies are well encapsulated. I can sub out a widget by just defining the requirements for that widget and the input and output calls. They do not need to understand the whole system rather just their box. As well my designers are able to take those widgets and drop them on the page and I am able to wire it all up. It is very clean, while maintaining the ability to rapidly develop and application. Finally, I use JAX-RS and JPA to build server side services. This part is pretty straight forward as JAX-RS provides all of the marshaling and unmarshaling of objects as well as all of the web API's for things like grabbing cookies and security.
- umen 16y agoThanks for the reply . what do you mean by : "...CMS to do all of my static page templating and export them out as static pages .." which CMS can do that? does using XMLhttp or other Ajax methods submitting json have preformants problem ? i mean isn't better to use simple requests?
- kls 16y agoI use Alfresco for multi-page apps and nothing for a single page app. As for performance, the difference posting a form via form post or as a JSON call is negligible but the nice part about jax-rs is you can change use multi-inputs so if you wanted to you could set a forms action to post directly to the REST service and write a handler for form post. So if you want to form post data you can. As well, you can still provide a json post service as well as make the get and put json services. So you can have handlers for plain text, XML, json, and form post for a single rest service and jab will serialize them into the same object for your routine. Personal I do it all via xhr request becase dojo and jquery have a nice API for serializing a form into a json object.