• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is declarative navigation?

 
dennis deems
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every time I try to learn about JSF I encounter this term, without any explanation of what it is. Could someone please explain?
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody correct me if I'm wrong on this but...

From my understanding declarative navigation is when you declare in the config files where you will go if you click a particular button. For instance, on your actual jsf page you might have a button that looks like this:



Then in your config.xml files you'll have something like this:



So in your button you're not actually hard-coding the location of a file, but rather a string. Your config files know that whenever that particular string gets returned, it should send you to whatever place you have set up in your xml files.

That's my understanding anyway, somebody please let me know if I'm wrong.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Declarative" anything in programming terms means that instead of Java code (or whatever language), you're defining something in a simpler, less flexible way. Declarative notation normally has no conditional constructs[*] and the overall syntax is simpler, making it easier to validate the declarations than it would be to debug Java code.

I put the asterisk [*] next to "no conditional constructs" because you can make a navigational rule conditional (contingent on an EL expression result), but what I mean is that the individual navigational rules themselves support nothing like an if/then/else or do/while structure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic