users@glassfish.java.net

Re: What's advanteges of JPA? Basic question about this technology.

From: Aleksandras Novikovas <an_at_systemtier.com>
Date: Mon, 08 Sep 2008 12:39:17 +0300

On Mon, 2008-09-08 at 01:38 -0700, glassfish_at_javadesktop.org wrote:
> Yeah, you are right my thread could be named "What are advanteges of 3 tier architecture" .
>
> But in most cases when i see frameworks like hibernate toplink etc. it in most cases i saw that this lead to 3-tier architecture and AS usage ;(. Yeah it's architecture decision but it will be not my decision :(.

Not necessarily ... I have successful projects with Hibernate in 2-tier.
It was user authentication in DB (everyone logged-in with own user name)
and quite a lot of business logic is held in DB.

I've migrated 2-tier to 3-tier ... and it is very easy because it can be
split into separate steps like: implementing basic functionality (still
using DB as security and business logic holder); implementing security
model in AS (without removing it from DB) - actually I try to keep
security in both as long as possible and etc.

>
> I would like ask you how you solve problems i described in my first post in 3-tier architecture. I dont imagine database which could be accessed only through AS. What happen in futurue when somebody will need another application or middleware working with database without AS?
If you use a single database and have implemented business logic in it
and DB security model suits your needs - just use it - no need to
rewrite it.

For more complicated scenario as an example I can take my current
project: 2 data sources (legacy database and new MSSQL-DB) and
distributed transactions plus very complex security model. For accessing
MSSQL-DB I use JPA. To enforce security model I have own JACC
implementation. Nice thing about J2EE is that security, business logic,
data layer and data presentation (UI has two implementations: thick
client (Netbeans platform) and thin client (GWT)) are completely
separated and changes in one layer does not affect the other while
interfaces are not touched.

As it was written in Ryan's previous post - developers have to find a
balance between putting some things to java and others to DB.
So talk to architects about where balancing point should be.

> [Message sent by forum member 'anorganic' (anorganic)]
>
> http://forums.java.net/jive/thread.jspa?messageID=297746
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>