|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 15
Messages: 15
Messages: 15
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
Possibilities for Annotations in JSF
Based on some of the comments on annotations made by Ed Burns (JSF Spec lead) in the recent Daniel Hinojosa wants replaceable managed beans in JSF post on TSS, Duncan Mills discusses some of the possibilities that a broader adoption of annotations might bring to JSF.
Some of them include: lifecycle methods, postback indicators (i.e., being able to tell if this is the original request, or a postback), routing capabilities ("return this view if the principal is in a given role"), security, and configuration outside of XML.
Even a short consideration of annotation possibilities within JSF raises more issues than I care to think about. However, there is no doubt that some areas such as security, where the linkage problem is not an issue, could be a very effective use of the annotation technique. I would certainly like to see the Expert Group address some of these possibilities in the future, hand in hand with the perhaps more important issues such as process scoping and sub-flows. Are annotations the right way to go? Are there more opportunities for using annotations that you can see?
|
|
Message #184781
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibilities for Annotations in JSF
You have to draw a very fine line though as to what JSF actually is... which is a UI component framework. A majority of the annotations he suggested pertain to Model/Controller behavior, outside of the UI component framework. So while there's opportunity to introduce UIComponent annotations-- POJO components within the JSF spec, the annotations that Duncan covers would be better used within a separate framework that is aware of persistence/business behavior concerns and lifecycle management outside of just the UI and is able to annotate concerns that aren't necessarily JSF specific, but leverage it's event-driven design and listener capabilities.
|
|
Message #184788
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Grey Area
Like it or not, JSF does play in the controller space and as such I feel that most of the suggestions are legitimate for discussion. But certainly the @Role annotation could be applied to any any bean in a container.
|
|
Message #184798
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibilities for Annotations in JSF
Of these, the lifecycle-ish ones look most viable to me. I don't think your managed beans is the right place to handle security. I think you are better handling it either:
1) Above, at the page layer (in web.xml configuration)
2) Below, at your services layer (e.g. in your EJB/Spring configuration).
Of the lifecycle methods, though, I like a lot of the suggestions. The postback indicators especially have possibilities.
As is generally the case with Annotations, I'd also like non-Annotation alternatives (XML or lifecycle interfaces).
|
|
Message #184799
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Implicit JSF annotations:
@DOA @DoYouHaveThatLatest32WayToRunHelloWorld @DoYouReadyToMissAnotherImportantDeadline
|
|
Message #184802
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Implicit JSF annotations:
@DOA @DoYouHaveThatLatest32WayToRunHelloWorld @DoYouReadyToMissAnotherImportantDeadline Wait for an announcement at the beginning of next week :-)
|
|
Message #184822
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Annotations and the IDE
It seems to me annotations ease the development process, leading to a reduced need for an expensive IDE.
|
|
Message #184850
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
It is so bad.
Why do we use that? It's a very bad thing. Could you please explain *why* you think using annotations in the described manner is "very bad"? I am definitely on the skeptical end of the opinion spectrum on many aspects of annotations, but I find myself generally agreeing with Duncan's description of use cases where annotations make sense (as well as where they do not make sense).
Craig McClanahan
|
|
Message #184896
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibilities for Annotations in JSF
I would love to see annotations for Managed Beans Custom Validators, Converters and Components
Also an option to generate the faces-config.xml entries for those annotations would be a nice feature. Something like:
@Converter @AddToFacesConfig
|
|
Message #184901
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibilities for Annotations in JSF
As a follow up to my first reply, check out a new product from JBoss called, "Seam". Instead of driving annotations from the view, it builds off of the EJB 3 spec to enhance JSF. Awesome stuff, and I mean *awesome*. You get all of the validation, injection (IoC), variable management, and transaction management as driven by your business model. It's annotations done the right.
As an example, one of my big pet peeves with JSF is the inability to assert logic on actions, Seam has that covered. Just do something like @LoggedIn, or @OrderInProgress over your bean's action methods. The foundation and capabilities are there to guarantee that JSF is the winner for Java WebTier.
Here's a tutorial: http://docs.jboss.com/seam/reference/en/html/tutorial.html
Main Page: http://jboss.com/products/seam
-- Jacob (JSF EG)
|
|
Message #184902
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibilities for Annotations in JSF
I should have also mentioned that this is the brain child of Gavin King, it wasn't enough that he took EJB to the next level, now he had to get his hands into the web tier ;-)
|
|
Message #184907
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Brainchild
With all my respect to Gavin it concerns me when backend people try to do UI. ORACLE Forms etc...
|
|
Message #184924
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Just wrong
Oh please don't give me 10 more ways to do JSF. I find it boated enough as it is just now.
JSP JSTL JFS etc.. containers are backwards compatible so you are able so see mixed implentations for a long time. Adding options to the mix just makes is more fussy. All of a sudden there is behavoir you did not forsee because someone has added an annotation somewhere you overlooked.
I would much more prefer an industry effort to make XUL a dominant player. This is what you can do with XUL just now. http://faser.net/mab/
So to google: Google make the XUL Browser IDE thing. AOL: cut ties with Microsoft and ship FF SUN: Free Java IBM, Oracle, HP, SAP, Eclipse foundation: create new web platform around XUL
Or else, deal with MS XAML
|
|
Message #184927
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Just wrong
Oh please don't give me 10 more ways to do JSF. One could make the same statement about the servlet container itself...
Pertaining to XUL, JSF is setting its sights on XUL, there are already a couple major vendors working on XUL Renderers. I wrote about XUL and JSF a while back on Java.net too.
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(January 21, Article)
Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala.
(January 15, Article)
Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language.
(November 24, Article)
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|