• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is "Persistence Franeworks" All about??

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I've just started to study the Struts and I find it very interesting. In the "How to Access a Database" FAQ bundled with the Struts, it mentions "Persistence Franeworks" which I don't understand as to what is it all about. Similarly, I am very much keen to see the Struts doing CRUD with Database(like MySQL). Can anybody help me to solve these confusions??

Thank you

Regards
Vikas
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, Struts is Web Framework only that it's not have abilities to access data in database BUT if you want to access database , you can use DAO, Persistent Framework such as hibernate, iBatis ...etc...


What's "Persistent Framework ?"


A persistence framework moves the program data in its most natural form (in memory objects) to and from a permanent data store the database. The persistence framework manages the database and the mapping between the database and the objects. There are many persistence framework (both Open Source and Commercial) in the market. Persistence framework simplifies the development process.

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats not entirely true. There are several ways to access dataSources in struts.

It just seems it's not the best practice to do it this way.
And that most of the methods are being depracated =/
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something else I was thinking about if Struts is only going to deal with the "web layer" and is not going to involve itself in the data layer or object persistence layer. What happened to the Model? in MVC? Seems that struts is moving towards being strictly a "view controller". OR am I missing something else fundamental here?

-Tad
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tad Dicks:
Something else I was thinking about if Struts is only going to deal with the "web layer" and is not going to involve itself in the data layer or object persistence layer. What happened to the Model? in MVC? Seems that struts is moving towards being strictly a "view controller". OR am I missing something else fundamental here?


The "M" is not going anywhere. It's just that Struts doesn't implement the "M" for you. The Struts Actions and Struts taglibs help you with the "VC" but you still need to implement the "M" pretty much all by yourself.

Then of course, you should probably be using other frameworks for implementing the "M" and other architectural components, for example with Hibernate and Spring.
 
author
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The model represents the state of the system. The state of the system may be persisted to a database, or not. The job of the model is to access or modify the state. How many layers down you want to put the database is up to you. You can have a really thin layer and access the database directly, or you can put in a DAO. Your choice. Regardless, its Struts job to provide you with a means to get at the model ... and that it does.

A layered design is an approach many people take because they feel it creates maintainable applications. A layered application is promoted by books such as Core J2EE Patterns http://www.amazon.com/exec/obidos/ASIN/0130648841/104-4340570-6820741

The following link from the Apache Struts site explains things far better than I have ...
http://struts.apache.org/userGuide/introduction.html#modelConcepts
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But they strongly recommend that we should separate the business logic from the role that Action classes play.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic