Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Differences between @javax.ejb.LocalBean and @javax.ejb.Local

 
Greenhorn
Posts: 17
Slackware Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
what's the difference between @javax.ejb.LocalBean and @javax.ejb.Local?
I'm new to EJB 3.1 and I always used the @javax.ejb.Local
when should I use this new annotation?
thanks
 
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use @LocalBean when the session bean has no local view / interface




Use @Local when you are using a local view / interface
(you can annotate the interface or the class)


 
Jeane Lindford
Greenhorn
Posts: 17
Slackware Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
o man this is so good
i hate to develop a lot of interfaces
why is a good practice to have one interface for all ejbs?
using only @javax.ejb.LocalBean sounds as a good and fast way to develop ejbs
thanks a lot and sorry my newbiness
 
kurt hanni
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In ejb 3.0 it is spec defined to have at least one interface per session bean, this has something to do with bean proxies

There are lots of pros in practicing "coding to interfaces", loose coupling, mocks, class template, etc.
I would prefer to use the implentation class directlty, unless I really need an interface.

remember no-interface-beans will only work on local beans, so if your using remote beans (app is distributed) you still need to write a remote interface
 
Jeane Lindford
Greenhorn
Posts: 17
Slackware Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot kurt
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic