NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


What have I learned?

Seam was created by Gavin King (also the inventor of Hibernate).
- allows seamless integration between EJB3 and JSF through managed components.
- promotes ORM.
- designed for stateful web applications.
- all the basic application components are inherently stateful (much easier to use than the HTTP session).
- Web 2.0 ready.
- The stateful persistence context in Seam acts as an in-memory cache.

I have learned some core frameworks in Java EE 5.0 that were being integrated here in Seam Framework.
They are:
* EJB (Enterprise JavaBeans) 3.0
-> converts Plain Old Java Objects (POJOs) into business service objects and database persistence objects.
-> server-side model that encapsulates the business logic of an application.
-> Types of Enterprise Beans:
-> Session Beans:
1. Stateful Session Beans - they keep track of which calling client they are dealing with throughout a session.
- access to the bean instance is strictly limited to only one client at a time.
2. Stateless Session Beans - are business objects that do not have state associated with them.
- access to a single bean instance is still limited to only one client at a time, concurrent access to the bean is prohibited.
- routes each request to a different instance if concurrent access to a single bean is attempted.
- Instances of Stateless Session beans are typically pooled.
Ex.: If a second client accesses a specific bean right after a method call on it made by a first client has finished, it might get the same instance.
3. Singleton Session Beans - are business objects having a global shared state within a JVM.
- controlled by the container (Container-managed concurrency, CMC) or by the bean itself (Bean-managed concurrency, BMC).
- can explicitly request to be instantiated when the EJB container starts up, using the @Startup annotation.
-> Message driven beans
- are business objects whose execution is triggered by messages instead of by method calls.
- Unlike session beans, an MDB does not have a client view (Local/Remote/No-interface).
- Only JMS support is required by the Java EE spec but Message Driven Beans can support other messaging protocols.
-> EJBs are deployed in an EJB container, typically but not necessarily, within an application server.
-> it uses "proxy" to dynamically obtain a reference of an EJB bean via EJB container.
* JSF2 (JavaServer Faces)
-> a web application framework.
-> uses Facelets (XML files called view templates) as its default templating system. (while JSF1.x uses JavaServer Pages(JSP) as its default templating system).
Facelets:
-> a web template system.
-> the default view handler technology (aka view declaration language) for JSF.
-> is a Model-View-Controller (MVC) component framework for web applications.
-> used in component-driven UI design-model
-> is often used together with AJAX (Asynchronous JavaScript and XML, a technology to add interactivity to web pages)
-> JBoss jBPM

-> the JSF UI component tree instantiated on the server exactly matches the UI components in the page (except for the automatically created UIViewRoot).
-> JSF lifecycle, the sequence of back-end "plumbing" events.

Work done by the JSF request processing lifecycle:

- applying request values,
- performing validation,
- interacting with the business logic and application model,
- performing navigation,
- and rendering a response

JSF Navigation Model:
* Presentation code (View)
* Back-end business logic code (Model)
* Front-end servlet that handles all Faces requests and dispatches them, along with the necessary application data, to the appropriate View component(page). (Controller)

* Faces Controller is implemented as a servlet that responds to all requests conforming to a certain URL pattern, such as /faces/*. Defined in the web.xml file

A request that uses the appropriate Faces URL pattern can be considered a “Faces request,” and
when received by the Faces Controller, it processes the request by preparing an object known as
the JSF context, which contains all accessible application data and routes the client to the
appropriate View component (page).

The rules that the controller uses for routing these requests
are centrally managed in the faces-config.xml file and are known as the JSF Navigation Model.

Navigation model is based on a set of “navigation rules,”

Sample navigation model: page 13 TCR

page3.xhtml
<navigation-rule>
<from-view-id>/page1.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/page2.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/page3.xhtml</to-view-id>
</navigation-case>
</navigation-rule>

-> This navigation rules can be ommitted if annotation based is used.
-> Additional info:
With the help of SEAM framework, it seamlessly integrated EJB components within JSF.
@Name tag is from SEAM to negated some of the unnecessary overheads in connecting from view (JSF) to entity (EJB)
-> Because in JSF, managed beans are expected to be simple JavaBeans.



Seam provides a consistent, annotation-based approach to integrate EJB3 and JSF.
Seam enables developers to use annotated POJOs for all application components.
Seam provides a number of JSF component tags and annotations that increase
the “web friendliness” and web page efficiency of JSF applications.
-> This includes the ability to generate bookmarkable web page (RESTful page) to be so easy.
Seam is a lightweight frameworkbecause it promotes the use of Plain Old Java Objects (POJOs) as service components.

Chapter 3: Seam JSF enhancements and the Facelets view framework for JSF?

Seam expands the EJB3 component model to POJOs.

jBPM
JBoss Rules (a.k.a. Drools)
iText
Spring


ORM performance can be greatly improved because the "extended persistence context"
acts as a "natural cache" to reduce database roundtrips.

Seam being stateful advantages:

- Seam are inherently stateful, meaning it declaratively manages their states.
- Seam’s stateful components also provide much finer
control over user states than the plain HTTP session does.
- Database caches and transactions can be automatically tied with the application state in Seam.
- The stateful persistence context in Seam acts as an in-memory cache (when in used with AJAX).
- It can hold information throughout a long-running conversation and thus help reduce the database roundtrips.


It supports JBoss jBPM business process engine
- makes state management even more efficient.

Seam wires POJO components together using a popular design pattern known as dependency injection(DI).




JSF:
-> server-side component framework for building Java technology-based web applications.
-> JavaServer Faces technology APIs are layered directly on top of the Servlet API.

LIFECYCLE of a JavaServer Faces application:

2 main phases are:
-> execute
-> render

* An application that is built and deployed on an application server is first in an uninitiated state.
* It then only gets compiled when an initial request is done for that specific app.
* The compiled Facelets application is executed, and a new component tree is constructed for
that application and is place in a javax.faces.context.FacesContext.
* The component tree is the populated with the component and the managed been property associated with it,
represented by the EL expression (hello.world).
* A new view is built, based on the component tree.
* The view is rendered to the requesting client as a form of response.
* The component tree is destroyed automatically.
* On subsequent (postback) requests, the component tree is rebuilt, and the saved state is applied.

Note: component tree is constructed whenever the compiled facelet app is executed (meaning if a request
is done, the page will make the component tree to get constructed).


FACELETS:
-> default view declaration language for JavaServer Faces technology.
-> Facelets is a part of the JavaServer Faces specification.
-> powerful but lightweight page declaration language.
-> is used to build JavaServer Faces views.

Tag Libraries Supported by Facelets:

* ui: -> JavaServer Faces Facelets Tag Library
* h: -> JavaServer Faces HTML Tag Library
* f: -> JavaServer Faces Core Tag Library
* c: -> JSTL Core Tag Library
* fn: -> JSTL Functions Tag Library


Define this in web.xml descriptor if the status of JSF application is Development software lifecycle:
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
-> If this is not set, the default value is Production.

Facelets technology offers several advantages:
* Code can be reused and extended for components through the templating and composite component features.





EXPRESSION LANGUAGE in JSF:




SEAM CONVERSATION COMPONENT CONTEXT:

Seam has implemented another layer of context inside Java EE:
-> Conversational context
-> it sits between a request and session scope.

* @Begin and @End - used to start a conversation context in SEAM.
* You cannot begin a new explicit conversation inside another conversation. It will generate exception.
* @Begin(join=true) - joining conversation
* @Begin(nest=true) - to create a nested conversation inside a conversation
- usually has a conversation ID.




------------------------------------

JBoss
-> is an application server
-> supports not only http or https but also CORBA, JRMP etc.



















     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.