Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Naming Conventions for XHTML and BackingBeans

 
Luke Murphy
Ranch Hand
Posts: 300
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any naming conventions for .xhtml files and for backing beans?

For example, should a .xhtml file being with lower or upper case?

Thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I prefer camel-case for the xhtml filenames myself, but if there's an actual recommended standard, I missed seeing it.

Backing beans are another matter entirely. If you use JSF2 annotations, the default name applied to the bean will be the bean's classname with the first character lowercased. Beginning a bean name with an upper-case letter is inadvisable, because only Classes should do that, not Instances, per standard Java conventions.

I normally like to suffix my bean classnames with "BackingBean". It's a bit redundant, since they're usually already located under a "backingbean" package level, but it does ensure that you don't end up with things like "com.x.backing.MyBean", "com.x.persistence.model.MyBean", "com.x.utils.jsf.validator.MyBean" and end up all confused when you see the simple name without knowing the exact context.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic