displayed using JSF views, business logic is encapsulated in CDI beans, information is persisted using JPA, and transactions can be controlled manually or using EJB
deploy the example by right clicking on the jboss-as-login project, and choosing Run As -> Run On Server
src/main/webapp directory
beans.xml and face-config.xml tell JBoss AS to enable CDI and JSF for the application
don't need a web.xml
src/main/resources
persistence.xml, which sets up JPA, and import.sql which Hibernate, the JPA provider in JBoss AS, will use to load the initial users into the application when the application starts
well, dependency injection, but moreover, the soa approach to service design tends to force otherwise intelligent software engineers into doing procedural design
the services just end up being bags of method calls that implement any type of behavior, with the domain objects or entity beans being reduced to mere data structures with little responsibility or behavior beyond persistence. (which, in this anti-pattern, is typically mostly provided by the repository or dao class! ie. domain object crud)
note, the 'i' here, is mr. MARTIN FOWLER!!
and of course, eric evans hails from domain driven design fame
fundamental horror
it's so
contrary to the basic idea of object-oriented design
combine
data and process together
procedural style design
completely miss the point of what
object-oriented design is all about
It's also worth emphasizing that putting behavior into the domain
objects
should not contradict the solid approach of using layering to
separate domain logic from such things as persistence and presentation
responsibilities
logic that should be in a domain object is
domain logic
validations
calculations
business rules
One source of confusion in all this is that many OO experts do
recommend putting a layer of procedural services on top of a domain
model, to form a Service Layer
this isn't
an argument to make the domain model
void of behavior
service
layer advocates use a service layer in conjunction with a behaviorally
rich domain model.
... and has the *most value* to an organization investing in writing their own software
infrastructure software (eg. user interface, orm, application server-related frameworks) or plumbing code should be treated as commodities where possible, unless, the business consciously decides that a custom, home-grown implementation is absolutely required for patenting or other differentiation reasons and/or that no existing off-the-shelf solution can be used
but these cases should be rare! do not blindly fall for the not-invented-here syndrome
instead of, say, attaching validation 'behavior' directly on, but still decoupled from domain classes themselves (eg. validation rule annotations on jpa entity beans)
history is persisted in the database
by means of a JPA entity bean and those objects are serialized back to the Flex client each time you enter a new name.
All entities marked as [Managed] are considered as corresponding to Hibernate/JPA managed entities on the server
It is highly recommended to use JPA optimistic locking in a multi-tier environment (@Version annotation
In conclusion, the recommended approach to avoid any kind of subtle problems is to have a real uid property which will be persisted
in the database
but is not a primary key for efficiency concerns
Here all loaded collections of the Person object will be uninitialized so uperson contains only the minimum of data
to correctly merge your changes in the server persistence context
Tide uses the client data tracking (the same used for dirty checking, see below) to determine which parts of the graph
need to be sent.
Dirty Checking and Conflict Handling
Data Validation
Tide integrates with Hibernate Validator 3.x and the Bean Validation API (JSR 303) implementations, and propagate the server validation errors to the client
UI components
free and more feature rich alternative to BlazeDS, but also outranks LCDS’ out-of-the-box features when it comes to data management, streaming media and integrating with mobile devices and Cloud computing
developer tools like code generation, invocation test drive and interoperability with multiple IDEs and frameworks
supporting integration with mobile clients (Android, Windows Phone 7, RIM Playbook and soon iOS) and the Java service layer, which includes support for Java POJOs, EJBs, Spring Beans, Grails controllers, Hibernate Objects and XML Web Services
the glory of Spring's founding myth of killing the beast that was J2EE seems to be fading. The former beast is now as manageable and easy to use as Spring ever was, or even more so
Deconstructing Spring myths
looking at the capabilities of the Spring Framework itself, where are the killer features?
list of reasons why I feel more productive on Java EE 6 than on Spring 3.1
these days there's really no reason for preferring vendor-specific APIs over JPA 2.0
Spring and Java EE applications mostly differ in the following areas only:
the web framework (Spring MVC vs. JSF vs. Wicket vs. Vaadin vs. Struts vs.....)
Spring Beans vs. EJB
Spring Dependency Injection vs. CDI or Java EE 5 @EJB or @Resource injection