672329 members! Sign up to stay informed.

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

Posted by: Joseph Ottinger on September 16, 2005 DIGG
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?

Threaded replies

·  Possibilities for Annotations in JSF by Joseph Ottinger on Fri Sep 16 10:00:09 EDT 2005
  ·  Possibilities for Annotations in JSF by Jacob Hookom on Fri Sep 16 10:59:25 EDT 2005
    ·  Grey Area by Duncan Mills on Fri Sep 16 11:25:20 EDT 2005
    ·  It is so bad. by Victor Jan on Fri Sep 16 22:23:44 EDT 2005
      ·  It is so bad. by Craig McClanahan on Sat Sep 17 03:57:40 EDT 2005
  ·  Possibilities for Annotations in JSF by Paul Strack on Fri Sep 16 13:16:03 EDT 2005
    ·  Possibilities for Annotations in JSF by karan malhi on Sun Sep 18 16:01:03 EDT 2005
  ·  Implicit JSF annotations: by Konstantin Ignatyev on Fri Sep 16 13:16:56 EDT 2005
    ·  Implicit JSF annotations: by Jacob Hookom on Fri Sep 16 13:22:42 EDT 2005
  ·  Annotations and the IDE by artful dodger on Fri Sep 16 15:22:35 EDT 2005
    ·  Expensive IDE? by Robert Hayes on Sun Sep 18 11:43:36 EDT 2005
  ·  Possibilities for Annotations in JSF by Jacob Hookom on Sun Sep 18 21:40:55 EDT 2005
    ·  Possibilities for Annotations in JSF by Jacob Hookom on Sun Sep 18 21:49:41 EDT 2005
      ·  Brainchild by Konstantin Ignatyev on Mon Sep 19 01:14:41 EDT 2005
  ·  Just wrong by jalki palki on Mon Sep 19 06:49:59 EDT 2005
    ·  Just wrong by Jacob Hookom on Mon Sep 19 07:56:42 EDT 2005
  Message #184781 Post reply Post reply Post reply Go to top Go to top Go to top

Possibilities for Annotations in JSF

Posted by: Jacob Hookom on September 16, 2005 in response to Message #184768
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

Posted by: Duncan Mills on September 16, 2005 in response to Message #184781
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

Posted by: Paul Strack on September 16, 2005 in response to Message #184768
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:

Posted by: Konstantin Ignatyev on September 16, 2005 in response to Message #184768
@DOA
@DoYouHaveThatLatest32WayToRunHelloWorld
@DoYouReadyToMissAnotherImportantDeadline

  Message #184802 Post reply Post reply Post reply Go to top Go to top Go to top

Implicit JSF annotations:

Posted by: Jacob Hookom on September 16, 2005 in response to Message #184799
@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

Posted by: artful dodger on September 16, 2005 in response to Message #184768
It seems to me annotations ease the development process, leading to a reduced need for an expensive IDE.

  Message #184842 Post reply Post reply Post reply Go to top Go to top Go to top

It is so bad.

Posted by: Victor Jan on September 16, 2005 in response to Message #184781
Why do we use that? It's a very bad thing.

  Message #184850 Post reply Post reply Post reply Go to top Go to top Go to top

It is so bad.

Posted by: Craig McClanahan on September 17, 2005 in response to Message #184842
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 #184888 Post reply Post reply Post reply Go to top Go to top Go to top

Expensive IDE?

Posted by: Robert Hayes on September 18, 2005 in response to Message #184822
What "expensive" IDE are people using these days??

  Message #184896 Post reply Post reply Post reply Go to top Go to top Go to top

Possibilities for Annotations in JSF

Posted by: karan malhi on September 18, 2005 in response to Message #184798
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

Posted by: Jacob Hookom on September 18, 2005 in response to Message #184768
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

Posted by: Jacob Hookom on September 18, 2005 in response to Message #184901
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

Posted by: Konstantin Ignatyev on September 19, 2005 in response to Message #184902
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

Posted by: jalki palki on September 19, 2005 in response to Message #184768
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

Posted by: Jacob Hookom on September 19, 2005 in response to Message #184924
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

Dependency Injection in Java EE 6 - Part 2

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 Q&A: What you must know about JavaScript, Scala and more

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)

Developers split on open sourcing Java

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)

Dependency Injection in Java EE 6 - Part 1

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: It's Not just for Web services

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)

Programming is Also Teaching Your Team

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)

Can Java EE Deliver The Asynchronous Web?

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)

JSF Flex

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)

The Rules of SOA - A Road to a Successful SOA Implementation

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 Talks About Terracotta 3.1

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)

Enterprise Application Integration, and Spring

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)

Google Web Toolkit: An Introduction

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)

Just Enough Early Architecture to Guide Development

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)

Productive Programmer: On the Lam from the Furniture Police

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)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

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)

Free Book PDF Download: Mastering EJB Third Edition

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)

Application Server Matrix

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)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map