Yesterday me and a friend were talking about the overuse of
Yesterday me and a friend were talking about the overuse of custom taglibs.
We create taglibs for everything. We create taglibs in order to wrap jQuery UI elements (tabs, button, etc), and other plugins elements as well. We often wrap them together in a single component. We use taglibs in a point that we almost have no pure html within the body tag.
Our question is: is this a healthy habit? Imagine two situations:
1) We hire an html designer and have the cost of a month for him to learn all this stuff.
2) We want to outsource the html development but no company would get our taglib library to learn, OR it become more expensive.
We love taglibs as its been a lovely shortcut for javascipt development as we write it only once. What would be the best practices in this sense, and what would you suggest? We are looking for a future-proof solution (or an argument that agrees with ours).
Solution
One of your uses of taglibs is to encapsulate JavaScript. Is it possible to do this with just a JavaScript file? (or a JavaScript file and a div so the JavaScript file can write out any HTML it needs. or a JavaScript file and a few regular HTML fields.)
JavaScript is very powerful. It has objects which let you avoid polluting the global namespace.
And no, as noted in the comments writing taglibs for everything is taking it too far. It\'s like you wrote your own JSF type language without the benefits of standardization.