JA>I can't help thinking this disconnect is due to coming from an OSGi/eclipse architecture where everything is a plugin. In Eclipse/OSGi everything is a bundle
And that's the thing, everything must be seen like a bundle, and if I can use my own terminology, I will say that everything must be seen like a self-contained and well-packaged extension (css, js, images,....) that can be plugged in to
make the whole system more larger.
JA>Having said that, the reuse problem is real and we suffer from it within our existing Orion pages as well.
And that's really true since there is a lot of duplication in your web pages. For example, why they
are all repeating themselves by including each time your core _javascript_ librairies (requirejs, dojo, dijit) ? Coudn't this action be done only one time and managed by a global entity? And maybe at this present time, you are really seeing the value of having on the server-side, a templating system like Tiles or Facelets so that a web page (View) can become the slave of a master page (Template)
1)
http://msdn.microsoft.com/en-us/library/wtxbf3hh%28v=vs.100%29.aspx Here is the anotomy of my own web pages and they are packaged into a set of reusable and pluggable modules which are just an aggregation of these following artifacts : css, js, images, html, REST web services written with Groovy, Scala,......
<ui:composition template="#{template}">
</ui:composition>
and inside
of them,
you will see my reusable UI Components that can interact remotely with your web services to display your data in an efficient way. And that is why, Most of them, do take an url as parameter.
<c:toolBar/>,
<c:wizard url="""/>,
<c:fileEditor url="""/>,
...........
And also, they know very well how to include their dependencies by themselves. For more about that, take a look at this blog post :
2)
http://weblogs.java.net/blog/lamineba/archive/2012/07/29/consuming-rest-service-within-jsf-using-jquery-and-handlebars-true-mvc-approachLamine