• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

RAD and ejb3 project

 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am implementing a ejb3 stateless session bean using RAD IDE. I create a ejb project. There are two classes I need to create

a)

@Local
public interface MyService {
...
}

b)

@Stateless(mappedName="ejb/MyService")
public class MyServiceImpl implements MyService {

...
}

Question --- In RAD, I create a new EJB project "myservice". Should I put both "MyService.java" and "MyServiceImpl.java" in this "myservice" project ?

or should I only put "MyServiceImpl.java" in "myservice" ejb project and create a separate java project to put "MyService.java" ?

Does both work and which is better way to do it ?
 
author & internet detective
Posts: 41998
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
I would put them both in the same (ejb) project. They go together and are unlikely to be used independently.
 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne. I tried separating them into two projects and it worked as long as that, in the ejb project, I set a project reference to that "interface" project. But I guess this is not a good practice, usually we should put them in ejbModule, right ?
 
Jeanne Boyarsky
author & internet detective
Posts: 41998
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
It is traditional, but not required, to put them in the same project. Because they get used together. Is there a reason to separate them?
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic