|
Replies:
10
-
Last Post:
Sep 8, 2008 2:39 AM
by: Aleksandras Nov...
|
|
|
|
|
|
|
What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 5, 2008 12:42 PM
|
|
|
Hello,
our company is moving to j2ee technologies and to JPA. I am most of all databse applicatino developer and i have simple question:
What's good on JPA?
First of all i found:
Business logic on AS is cool. What? I think BL is better on database layer, because if i make BL on AS i must go everytime through AS and i think this is impossible in real world.
Second: Database independent. OMG, why this? we have oracle and we want use this as a cool database, moving to another db is the most worst idea. And i think JPA looks so AS dependent.
better performace - AS can cache data: i think there will be no better performnce than our db if AS is better than database - i think this company can move their business and instead of AS can sell db servers. And cache on AS is no good idea because our data can be changed using another application which dont use AS.
complex security rules and roles OMG this have our databases since their beginning. And why i must write this rules again to AS and manage them again?
And something i dont like: AS uses one account for database connection. We can use oracle proxy auth but why we need AS than? And can u tell me how it is with complex queries? really complex not one join  And can u tell me why u use JPA - where is advanteges of this technology?
Really thanks for answers, your experiences and opinions.
Jakub.
Message was edited by: anorganic
Message was edited by: anorganic
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 6, 2008 4:48 AM
in response to: anorganic
|
|
|
Would help if you could say what you're comparing it to. By the sounds of it you don't use an ORM usually, what's your background?
On Fri, Sep 5, 2008 at 8:42 PM, <glassfish@javadesktop.org> wrote: > Hello, > > our company is moving to j2ee technologies and to JPA. I am most of all databse applicatino developer and i have simple question: > > What's good on JPA? > > First of all i found: > > Business logic on AS is cool. > What? I think BL is better on database layer, because if i make BL on AS i must go everytime through AS and i think this is impossible in real world. > > Second: > Database independent. > OMG, why this we have oracle and we want use this as a cool database, moving to another db is the most worst idea. And i think JPA looks so AS dependent. > > better performace - AS can cache data: > i think there will be no better performnce than our db if AS is better than database - i think this company can move their business and instead of AS can sell db servers. And cache on AS is no good idea because that can be changed using another application which dont use AS. > > complex security rules and roles > OMG this have our databases since their beginning. And why i must write this rules again to AS and manage them again? > > And think i dont like: > AS uses one account for database connection. We can use oracle proxy auth but why we need AS than? > And can u tell me how it is with complex queries? really complex not one join  > And can u tell me why u use JPA - where is advanteges of this technology? > > Really thanks for answers, your experiences and opinions. > > Jakub. > [Message sent by forum member 'anorganic' (anorganic)] > > http://forums.java.net/jive/thread.jspa?messageID=297530 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net > For additional commands, e-mail: users-help@glassfish.dev.java.net > >
-- Rasputnik :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 6, 2008 6:34 AM
in response to: Dick Davies
|
|
|
Also the question may possibly be answered by googling "Toplink Essentials" and read up on why Oracle developed and released it to the open community.
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 7, 2008 1:08 AM
in response to: Dick Davies
|
|
|
I am working with Oracle Forms (really cool tool - i dont understand why oracle dont sell something like dthis in java - ADF is so far from this) and Java, JSP, JDBC. But i am not comparing i ask on advateges of this technology why u use it and i send few question which i find as a problem and disadvanteges.
I understand that O-R mapping can save my time comparing using JDBC but i find lot of feature what i dont want - and i can imagine that others developers want them = i am not right ot there are some tricks.
And about toplink and oracle AS - of course i read something (and i pass official oracle course about j2ee too) and find lot of this material as marketing output as u can read in my first question. Cache, Pooling, Roles etc.
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 7, 2008 12:11 PM
in response to: anorganic
|
|
|
I have found using the JPA that DB interfacing is much simpler, adapts to change much more quickly, and that I think about the database less and less in my code.
In the past I would think of the schema, its structures, the values in the columns etc., but today I think less on those terms and rather focus on my internal application services and APIs. I find once I've tested them, I can ignore the underlying DB details for what I want to do. In fact I recently had a colleague ask my what the data in a certain table should look like for a specific situation, and I told him I didn't know since I rely on the internal APIs. Even our database queries are most likely done via Toplinks Expressions API (not a part of JPA, but will be in JPA 2, and similar to Hibernates Criteria API), rather than EQL or SQL.
I find the JPA lets me spend far less time staring at SQL and SQL output and more time focusing on my code and APIs rather than worrying about the database.
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 7, 2008 1:16 PM
in response to: whartung
|
|
|
Yeah but how you solve roles and privileges are you using application server policy? Waht's about application cache? And where you have business logic ? If in java code what are you doing when u need apply this logic in another application not written in java? etc.
I can imagine that you can be faster and you can leave database solutions but i see this problems and i want listen from anybody using these technologies how it solve this areas. Thanks a lot for your reply.
Message was edited by: anorganic
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 7, 2008 2:06 PM
in response to: anorganic
|
|
|
Even when using straight JDBC I think a lot of developers still only use one user account to access the DB, and do all security related features in their Java code. Personally I have never used an application where each user was a real database user with table level security etc.
Since business logic can be programmed in a service layer separate from the UI, it could be exposed as a web service, remote EJB, CORBA, or whichever technology you prefer. Database is just for storing and loading data, and we don't make use of more advanced features. JPA lets us hide the database even more since we never have to see or write SQL.
I guess that's OK for small systems, and larger more advanced systems will perform much better when business logic is moved into stored procedures, triggers, etc. I guess developers have found a balance between putting some things in Java and other things in the database.
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 7, 2008 2:11 PM
in response to: anorganic
|
|
|
Hi,
Security and business logic are not JPA issues.
As I see your environment is mixed: different applications (maybe different vendors) accessing DB. Most probably you have to stick holding business logic and security in DB.
It is architectural decision.
Anyway it does not deny your ability to use JPA for java applications. Just invoke DB stored procedures and queries as you would do from other applications (PHP, .NET). JPA will help you reduce a lot of code related to JDBC.
Most probably current environment has some shortcomings (which I'm not aware of) otherwise your company would not make decision to move to j2ee.
As I understand it is not about JPA. It is about 2-tier or 3-tier.
I would suggest to ask decision makers - why?
If you make decision to change environment and move to 3-tier architecture then you have to move business logic and security to application server. DB becomes only storage. 3-tier allows you work with different data storage (not necessary SQL-DB) in one application and not all of them can implement (or hold) security model or business logic.
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 8, 2008 1:38 AM
in response to: Aleksandras Nov...
|
|
|
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 .
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?
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 8, 2008 2:29 AM
in response to: anorganic
|
|
|
glassfish@javadesktop.org schrieb: [...] > 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? [...]
JPA doesn't require to run inside an application server, actually you can pretty well use it for standalone applications. So overally this migration would be alot easier than, in example, following your managements decision to use DB2 rather than Oracle in the next release while having built all your application logic directly to the database.  Cheers, Kristian
-- Kristian Rink cell : +49 176 2447 2771 business: http://www.planconnect.de personal: http://pictorial.zimmer428.net "we command the system. calling all recievers. we are noisy people for a better living". (covenant - "monochrome")
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: What's advanteges of JPA? Basic question about this technology.
Posted:
Sep 8, 2008 2:39 AM
in response to: anorganic
|
|
|
On Mon, 2008-09-08 at 01:38 -0700, glassfish@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@glassfish.dev.java.net > For additional commands, e-mail: users-help@glassfish.dev.java.net >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|