• 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

Architecture- Struts bigger scene.

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, now my question is about architecture and trying to figure out what happened here. This is a Struts application, so I am working on seperating the Business logic out of the Presentation and Data Access tiers. I have been reading the Professional Struts Application book original throuhg Wrox, but now through Apress. I understood all the aspects of the book, but now I am creating my own application and wondering what happened to the design, that I am not following.
I think they had a Stateless Session EJB, then are no longer using it after they added the ObjectRelationalBridge OR mapping tool and used DAO objects.
So now in my application, I have this Stateless Session Bean that I was going to start writting code for, but thinking now that it isn't part of the design.
So the Action class will call a Business Delegate class, which calls a ServiceLocator class to get access to the EJB, I think, or it might just get access to the DAO object instead, and not even use the EJB?
I know this might sound cryptic, but maybe someone could help.
Thanks
Mark
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't figure out why you would eliminate a stateless session bean if you just switched your persistence layer. That just doesn't make any sense. Service layers and session facade exist for their own reasons -- they're not intimately tied into persistence.
I'd revisit that decision...
Kyle
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought the same thing, but the sample code from the book, which I downloaded, had all the Lookup code for accessing the Session Bean all remarked off.
Thanks
Mark
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Start small", I say. You can remove the extraneous EJB layer afterwards as well. Doing too much work keeps your codebase "in the red" for longer than small steps would.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actully John Carnell, the author, told me what I was missing. The actual application doesn't use EJBs. It does not need the Transactions, or Security that an App Server will provide. It is a simple application that adds stories and comments, almost like a blog.
The EJB, portions in the book, is for demonstration about the architecture being decoupled, such that if you need to add the transaction level and complexity of another layer with EJBs, then adding that in is as simple as adding a method or two into the ServiceLocator class and you are done. Well besides writing the EJBs.
Now, that makes more sense to me. I mean why add the overhead of the JNDI lookup and returning a Home, then creating the Session Bean, then calling a method, when you can use simple and straightforward Plain-old Java classes.
Thanks for the help guys.
Mark
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic