2

I am working on a JSF web app project where external web developers are providing all (static) HTML, CSS & JavaScript. What is the best way to split the pages into JSF components but also to manage changes to the design in the future.

Is to bad practice to leave all html pages intact, and add any JSF components as required for dynamic content? (This would help for managing versions)

Or should the entire site be split into atomic JSF components and follow standard JSF guidelines?

What issues do you think would be encounter by doing this?

j.davies
  • 2,321
  • 1
  • 19
  • 24

1 Answers1

2

Ideally, the external developers would be able to do JSF too, and create reusable composite components.

But if they are only providing static HTML & CSS, someone must manually convert their code into reusable components. So, whenever you need to change something layout related, you just update the components and all the client code will be up-to-date. Also, you'll probably find ways of reducing code duplication that is common in stylized HTML/CSS.

You could, yes, simply start adding the JSF components as required, but that probably would be feasible if you only had one page, or if every page you did needed very different markup and styles. And it wouldn't do much to help you with version control, because you would end up having to update every one of the pages whenever you need to change something.

I suggest you take a good look at JSF 2.0 composite components, and try to use them as much as you can. Sometimes, though, an ui:include might be a better option, so you'll want to understand the difference between these two to be able to know when to use which.

Community
  • 1
  • 1
Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107
  • 2
    [`jsfc` attribute might also be helpful for the designers](http://stackoverflow.com/questions/10504190/is-there-a-way-to-run-a-jsf-page-without-building-the-whole-project). – BalusC Jun 05 '12 at 03:11
  • Thanks for this answer, very useful. I never knew about the jsfc, thanks @BalusC – j.davies Jun 13 '12 at 01:44