EJB Structure/Architecture

Hi I'm going to begin a new project here im my company, and we have already a project running with EJB, the problem is that this other project was defined by another person here and I disagre with somethings but I would like to hear you all to see if these things I'm talking about is really wrong or not.
Ok, lets start off, in the server side everything is defined exactly like usually, we have sessionBean implementing the right interface and a localHome and remoteHome an EntityBean very well written, but in the client side that is my point, there is a definition of a client and a helper that I think is totally wrong (or not, I don't know).
The helper and client both implement an unique interface. The client only knows in wich helper use and a helper knows wich ejb connect to. Then supposing that we have a web environment using struts we would think like this, after the user submit an form the execution goes to a given action where I create my client and call a specific method wich will only call a helper wich will know where to connect to in my server.
I don't think it should be like this but I don't think that the way this guy defined the things would be the better way, please I need suggestions, points and so on. If you need
further informations about, please let me know.
Thanks a lot
Dorileo

Ok, lets start off, in the server side everything is
defined exactly like usually, we have sessionBean
implementing the right interface and a localHome and
remoteHome an EntityBean very well written, but in
the client side that is my point, there is a
definition of a client and a helper that I think is
totally wrong (or not, I don't know).It sounds like a BusinessDelegate, which is not wrong at all.
http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html

Similar Messages

  • Entity EJB Relationships Architectural Question

    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I define
    the relationships (EJB 2.0)? If it is not, how would you build it?
    Thanks for helping me out,
    Thomas A. Valletta

    Thanks Slava,
    You deserve more than a free trip to a conference for the time and effort
    that you put into this board. I think you should be able to write this off
    as a charitable contribution on your taxes. If you need someone to sign the
    receipt, just let me know.
    Anyway, back to my hierarchy issue(s). I found some information that
    weblogic will set-up this kind of many-to-many relationship for you if you
    set it up correctly in the weblogic-cmp-rdbms-jar.xml and the ejb-jar.xml.
    So I went through the DTDs, but despite the examples the help is extremely
    vague. Has anyone done this? Could anyone recommend where I could find
    something more on the topic (books, magazine articles, online documentation,
    code, etc)?
    Thanks again,
    Thomas A. Valletta
    "Slava Imeshev" <[email protected]> wrote in message
    news:3ec552f9$[email protected]..
    Hi Thomas,
    "Thomas A. Valletta" <[email protected]> wrote in message
    news:[email protected]..
    I need to create a hierarchy of simple objects. I will call my object
    "Part" for simplicity. I have two Oracle tables to maintain my Part
    hierarchy. The first table contains the detail for the part: number and
    name. The second table maintains the relationship: parent_number and
    child_number. I built Entity EJBs with CMP for both tables, but I don't
    know if that is the "best practices" approach. If it is, how do I
    define
    the relationships (EJB 2.0)? If it is not, how would you build it?The best approach is the one that works for you. If the
    combination of two beans works, leave it as is and
    go ahead with next tasks.
    Regards,
    Slava Imeshev

  • How do I update web service structures?

    I have an EJB that exposes a few business methods. I've also created an unauthenticated web service that exposes a couple of the business methods.  This all works fine, and has been deployed to another runtime environment.
    I've now made some changes to one of the underlying structures that is returned by the EJB.  How do I update the web service to now return the new structure?  The genereated wsdl does not contain the new updated structure, so I can't get at the new values I've added to the structure.  I understand that changing a structure that is currently being used by a web service is not the best thing to do, but in this case I'm ok since the web service it not yet being used.
    I've tried dropping the wsdl and re-creating it from scratch, but then I get the message 'item not described in the schema' - since the EJB, structure, and Web Service are all in the same EAR, how can this be possible?  It's almost as if the VI isn't being updated correctly.
    I'm on NW2004s/sp10.
    Suggestions?

    Hi Ken,
    Even I have faced similar problem in the past. The sure way to change schema in WebService is create VI again and re-redploy the web service.
    Hope it works
    Regards
    Smruti

  • Deployment choices for EJBs

    I'm very new to EJBs and reading as quickly as I can. I'd like to know if any rules of thumb exist for EJB deployment architectures. Particularly, at the moment our EJBs are for database access from a remote computer. Do I have a single generalized EJB for database access? Or do I have a separate EJB for each specific database access? Do I have JSP on the web server talk directly to the EJB, or do I introduce some intermediate object, and if so, what kind? Are there any design white papers I can read? None of the books I've bought on EJBs discuss these implementation details.

    I also have the same questions in my mind. Can someone advice?

  • Web app security + JAAS

    I'm working on the authentication/authorisation aspects of a fairly
    large web application using WLS 6.0 (ie allowing users to login and
    access resources based on role etc).
    Its a standard JSP/Servlet/EJB type architecture and so far it seems
    the FORM-based authentication will serve our needs well. However, I've
    been instructed (by higher powers) to investigate JAAS authentication.
    It looks far more complex to implement so my question is, does it
    offer any significant advantages that justify the extra work?
    Thanks for your time.

    "john hryn" <[email protected]> wrote in message
    news:3fce2551$[email protected]..
    >
    Hi,
    I am using WebLogic 8.1 platform. I am trying to create a very basicsecure web
    app.
    I created an App and created a web project. In it, I deleted thecontroller, etc
    and just have index. jsp. All the index.jsp does is: <%=request.getRemoteUser()
    %>
    In web.xml I have
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Success</web-resource-name>
    <url-pattern>*.jsp</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
    <role-name>*</role-name>I think you should have dealers instead of *
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>default</realm-name>
    </login-config>
    <security-role>
    <role-name>*</role-name>And here too.
    </security-role>
    In weblogic.xml I have
    <security-role-assignment>
    <role-name>dealers</role-name>
    <principal-name>dealer1</principal-name>
    </security-role-assignment>

  • Producer/Consumer Design Pattern with Classes

    I'm starting a new project which involves acquiring data from various pieces of equipment using a GPIB port.  I thought this would be a good time to start using Classes.  I created a GPIB class which contains member data of:  Address, Open State, Error; with member vis such as Set Address, Get Address, Open, Close...general actions that all GPIB devices need to do.  I then created a child class for a specific instrument (Agilent N1912 Power Meter for this example) which inherits from the GPIB class but also adds member data such as Channel A power and Channel B power and the associated Member Functions to obtain the data from the hardware.  This went fine and I created a Test vi for verfication utilizing a typical Event Structure architecture. 
    However, in other applications (without classes) I  typically use the Producer/Consumer Design Pattern with Event Structure so that the main loop is not delayed by any hardware interaction.  My queue data is a cluster of an "action" enum and a variant to pass data.  Is it OK to use this pattern with classes?  I created a vi and it works fine and attached is a png (of 1 case) of it.
    Are there any problems doing it this way?
    Jason

    JTerosky wrote:
    I'm starting a new project which involves acquiring data from various pieces of equipment using a GPIB port.  I thought this would be a good time to start using Classes.  I created a GPIB class which contains member data of:  Address, Open State, Error; with member vis such as Set Address, Get Address, Open, Close...general actions that all GPIB devices need to do.  I then created a child class for a specific instrument (Agilent N1912 Power Meter for this example) which inherits from the GPIB class but also adds member data such as Channel A power and Channel B power and the associated Member Functions to obtain the data from the hardware.  This went fine and I created a Test vi for verfication utilizing a typical Event Structure architecture. 
    However, in other applications (without classes) I  typically use the Producer/Consumer Design Pattern with Event Structure so that the main loop is not delayed by any hardware interaction.  My queue data is a cluster of an "action" enum and a variant to pass data.  Is it OK to use this pattern with classes?  I created a vi and it works fine and attached is a png (of 1 case) of it.
    Are there any problems doing it this way?
    Including the error cluster as part of the  private data is something I have never seen done and ... well I'll have to think about that one.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • What is the advantage of using Wrapper Classes ?

    Hi friends,
    I am happy to join Java/J2EE tech. My project is scaled over the network. MVC-II struts, EJB based architecture, we are using.
    We are asked to use Wrapper Classes in in Java programs and not the primitive data types. I could not understand the reason.
    Pls tell me what is the advantage of using Wrapper Classes over the primitive data types ?
    means Integer instead of int, etc....

    Hi friends,
    I am happy to join Java/J2EE tech. My project is
    scaled over the network. MVC-II struts, EJB based
    architecture, we are using.
    We are asked to use Wrapper Classes in in Java
    programs and not the primitive data types. I could
    not understand the reason.
    Pls tell me what is the advantage of using Wrapper
    Classes over the primitive data types ?
    means Integer instead of int, etc....I am not sure why use Integer over int; but Wrapper classes are used to remove coupling between classes and create one hand doesn't know what the other hand does effect.
    for example:
    when you have a SFTP java package but doesn't do everything that your application needs to do in one step and you need to do sftp stuff at many places in your application, it would be wise not to use SFTP java package directly from all the classes that need to do sftp stuff. Because if you were to change the SFTP package later due to say some bug fix or newer version or ... you would have to go and modify all the classes that had sftp stuff to update.
    Instead you could write a custom sftp wrapper that handles all the sftp stuff for your application needs and that wrapper deals with the SFTP java package. So all the classes don't need to know which SFTP java package is being used only the custom-wrapper needs to know.

  • Fault tolerance in Weblogic

    I am working on the Servlet and EJB based architecture on WebSphere
    Application server. The application has stringent Fault Tolerance
    requirement i.e. if the http/application server goes down then also the
    users are not effected.
    I will appreciate any help in this regard i.e.
    1. When one server of the server goes down then the same session object
    should be accessible through some other server so that the user does not
    get to know of it.
    2. In case of EJBs, if the application server goes down then how the
    stateful EJB can be available on some other machine
    3. Anything on the deployment scenerio
    Thanx
    Bharat Bansal

    <[email protected]> wrote in message
    news:[email protected]..
    I am working on the Servlet and EJB based architecture on WebSphere
    Application server. The application has stringent Fault ToleranceI doubt BEA is going to give you much help on IBM's WebSphere product. Boy
    are you in the wrong newsgroup.

  • Fault tolerance in WEbLogiv

    I am working on the Servlet and EJB based architecture on weblogic
              Application server. The application has stringent Fault Tolerance
              requirement i.e. if the http/application server goes down then also the
              users are not effected.
              I will appreciate any help in this regard i.e.
              1. When one server of the server goes down then the same session object
              should be accessible through some other server so that the user does not
              get to know of it.
              2. In case of EJBs, if the application server goes down then how the
              stateful EJB can be available on some other machine
              3. Anything on the deployment scenerio
              Thanx
              Vipul Rastogi
              

    Hi Vipul,
              Please do not crosspost (post the same question in multiple newsgroups).
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              <[email protected]> wrote in message
              news:[email protected]..
              > I am working on the Servlet and EJB based architecture on weblogic
              > Application server. The application has stringent Fault Tolerance
              > requirement i.e. if the http/application server goes down then also the
              > users are not effected.
              >
              > I will appreciate any help in this regard i.e.
              > 1. When one server of the server goes down then the same session object
              >
              > should be accessible through some other server so that the user does not
              >
              > get to know of it.
              >
              > 2. In case of EJBs, if the application server goes down then how the
              > stateful EJB can be available on some other machine
              >
              > 3. Anything on the deployment scenerio
              >
              > Thanx
              >
              > Vipul Rastogi
              >
              

  • Harnessing DB's capabilities and Java

    Guys..
    I have this question about DB and PL/SQL
    Till now we have been making database calls for select, update and other DML uses from within the program that can be a scripting page like ASP, JSP of CFML or we make direct DB calls from the components written in either VB/JAVA or any other langaage.
    My concern and question is that what is the most ideal sceneario keeping performance and other issues in mind to make calls for DML to DB. Should we be harnessing the capabilities of DB in terms of stored procs , packages and triggers or call directly the statements for DML from within the component?
    What makes more sense and also is it advisable to make multiple users on the database and grant them privelages to certain tables depending upon their access on data or let the applcation decide the user role and let them handle data according to their roles in application.
    Please let me know as i want to know the thoughts about the same.
    Thanks in advance
    Ashish

    This would depend on your requirement.
    There are advantages/disadvantages of using PL/SQL
    extensively for any DML operation. Again, there are
    pros/cons of putting all the business logic(considering
    the business logic is in stored proc) in a J2EE style
    EJB/JDO architecture. Finally, there is this cost
    factor, rapid development/deployment senario which
    would dictate one or the other or a mix of both.
    Having said all that, your question is also about the
    style of programming(am I right??), and certainly, in this case do not put DMLs every where in every script.
    As for the second question, I think your second option
    is better.

  • OSX Server 10.6.3 - (Multiple) Website hosting via Server Admin

    Has anyone else experienced/had this problem? I am posting this hear in hopes that someone else has experienced this as well and may know how to correct/resolve this problem.
    We currently have purchased a collaboration software I have installed and I am running via OSX. The files are stored in /Library/WebServer/Documents/collab. OSX comes with a default website built in at /Library/WebServer/Documents. I intend to install the collab website in anticipation of adding more sites in the future and possibly utilizing the default OSX web services as well. I have set up our internal DNS server to route collab.company.com to the internal ip address of our OSX server. The default OSX webpage is currently hosted on port 80, I am running our collab site on port 8x (we are already hosting websites on a different server on port 80, and the router can only forward port requests to a single ip address).
    With this configuration, if I enter the address of collab.company.com, I get the default OSX server running on port 80. If I enter collab.company.com/collab, I then get our collab website (on port 8x). Essentially I want collab.company.com to open the collab website, not the OSX website. What is odd is, it seems that if I uncheck the default OSX webpage in server admin and disable it, change the collab site to port 80 as a test and go to collab.company.com I get a failed connection that the site is down or doesn't exist, like it is offline. It seems almost as if OSX is completely shutting down the entire directory of /Library/WebServer/Documents which is where the collab website exits inside of (Documents/collab). If I re-enable the default OSX website, then both websites become live again.
    So I guess my question is, is there a different structure/architecture that should be followed to prevent this behaviour? If so, how do I get multiple websites installed and configured properly in server admin to respond to their appropriate dns requests. I also forgot to mention for my collab site entry in server admin I have the host name in the general tab as collab.company.com, as well as the alias collab.company.com, but when I enter collab.company.com I am getting the default OSX site.

    I agree, this seems to make sense in theory, but here is the result I am getting.
    I have my internal (not my osx server) dns server containing a host entry of collab.company.com = 192.168.1.xx. I have a virtual host entry in OSX in the aliases area (correct?) of collab.company.com for my collab site. However, whenever I enter the url in my browser of collab.company.com, I keep getting the default Mac OSX Server website page. I even put an alias in the OSX server site of mainpage to try and differenciate it, but it doesn't seem to take or matter.
    So once again, in theory I think "oh, just uncheck the enable button next to the default OSX website", I uncheck it, and then both of my websites are offline, or appear to be? For my collab site, the link redirects, but I get the error page.
    Safari:
    Not Found
    The requested URL /collab/public/index.php was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.2.14 (Unix) PHP/5.3.1 Server at collab.company.com Port 80
    Google Chrome:
    Oops! This link appears to be broken.
    Thing is, I even changed my collab site to be running on port 80 as well as a test. I check enable for my osx default page, and they are both back online. If I change the default osx sites port to say 87 or something, and leave the collab at 80, I then get the same bad request messages etc. If I put the osx site back to port 80, they both work.

  • General panel layouts in

    I am learning Java but I don't feel/find this to be a newbie question.
    I am a prof. prgmr but usually using languages with external display definitions. As a side job I am learning Java (for my own pleasure & future) to provide a friends startup business with some 'entry stuff' to replace the pen and paper.
    question:
    Concerning display layouts for multiple 'panels' (sorry for improper naming) I am advised to use "CardLayout". I personally do not feel confident that this would be a standard solution for bigger applications.
    Now I am starting out small but would like to know what a general structure/architecture would be in the 'real' world to maintain and display panels to the user.
    Would anybody have some suggestions (links?) to examples/suggestions for an architecture that would (evt.) provide structure for maybe some dozen(s) panels? Especially if it would be modular in any which way?
    I hope my question is clear. I just feel unconfident about a f.i. 40 cards cardlayout.
    But as said, I don't seem to be able to find examples that "create and destroy" panels like I am used to in my 'older' programming languages (opening and closing 'display files').
    Thank you for any suggestions!
    You know how it feels when you can start with a good base.

    Its hard to give general advice to a general question since we don't know what your application does or how the user interacts with the application.
    Well using CardLayout is good for a wizzard type of application. All the panels are created up front and the layout determines the maximum size of all the panels so then when you pack the screen it gets resized once.
    On the other hand an application like Internet Explorer only has a single main window. All other windows are dialogs. Each dialog has its own panel and size.
    There is nothing to stop you from creating panels on the fly and adding / removing then from the content pane as you go. The trick is that once the GUI is visible you need to revalidate() the parent container so that the layout manager is invoked and the panel is displayed properly. Sometimes when you removing and adding a single panel you also need to use repaint() to make sure it get painted correclty.
    Each panel can be created in a separate class.

  • Clustered EJBObjects

    I am attempting to configure a multi-tier (web, servlet, ejb) cluster architecture. My problem is a very basic one. How does the servlet cluster know about the object cluster? Since they are different clusters, their JNDI trees are not the same so they can't advertise their objects. I've read that an EJBObject stub is supposed to be aware of all EJB replicas. How and where is this configured?
              Please help.
              Thanks,
              Dave Mrozek
              

    If you have dns name servletcluster that maps to all the servers in the servlet cluster and if you have a dnsname objectcluster that maps to all the servers in the object cluste, when you do a lookup on the url t3://objectcluster:7001/ from the servlet engine you will automatically get replica aware objects if your ejb's are build as clusterable objects.
              2. Deploy all your clusterable ejb's on all the servers in the object cluster and when you do a lookup you will automatically get clusterable stub's. You don't have to do anything, its all transparent to the user.
              Hope this helps.
              - Prasad
              David Mrozek wrote:
              > I am attempting to configure a multi-tier (web, servlet, ejb) cluster architecture. My problem is a very basic one. How does the servlet cluster know about the object cluster? Since they are different clusters, their JNDI trees are not the same so they can't advertise their objects. I've read that an EJBObject stub is supposed to be aware of all EJB replicas. How and where is this configured?
              > Please help.
              > Thanks,
              > Dave Mrozek
              

  • Problem in creating EJB and WebService using complex class structure

    Hi All,
    My requirement is like :
    I have a class with very complex structure.
    I have also used external .jars.
    Now when I have created an EJB with a method's return parameter as above class.
    But when I am creating a Webservice, it doesnot allow me to select this method.
    Not able to configure why ?
    Please Help.
    Thanks.

    Hi,
    I have gone through your code and the problem is that when you create jar it takes a complete path address (which is called using getAbsolutePath ) (when you extract you see the path; C:\..\...\..\ )
    You need to truncate this complete path and take only the path address where your files are stored and the problem must be solved.

  • What is the directory structure of EJB applications?

    I am new to EJB program. I know that after the development is done, we package the EJB components into .jar file, and package the Web components (HTML/JSP/Servlets/JavaBeans) into .war file, and then together we package .jar file and .war file into a single .ear file. Then we just deploy the .ear file into WebLogic's application directory.
    But, before the deployment, I mean during the development, what kind of directory structure is good for us to develop our EJB, HTML, JSP, Servlets, and JavaBean components?
    Previously, when I was doing JSP/Servlets applications, my directoy structure is:
    webapps\
    --------myapplication\
    -----------------------*.html
    -----------------------images\
    ------------------------------*.jpeg, *.gif
    -----------------------jsp\
    ------------------------------*.jsp
    -----------------------WEB-INF\
    ------------------------------web.xml
    ------------------------------classes\
    -------------------------------------Java Servlets located here
    -------------------------------------beans\
    -------------------------------------------JavaBeans are located here
    Now, I am doing EJB applications, what should be the directory structure?
    Thank you very much for your help!
    Jingzhi

    I have been involved in a few enterprise applications but have not been happy with the packaging structures used and am starting a new one now and am looking for other examples.
    this is what I've used before.
    web/
    classes/
    client/
    server/
    but if a class was used in the client and server it was put under the server/ package. I feel that more separation is needed.

Maybe you are looking for

  • IPhone 4s screen can't be scratched

    I've got an iPhone 4s like 6 months ago. I protect my screen with a screen protector, but my friends told me that iPhone's screen can't be scratched, its this true?

  • JAVA Class error .. cannot locate the issue (my code included)

    I am diving into JAVA, and I am experiencing a little bit of difficulty. The code below is not working :: package therectangeclass; public class Rectangle { private double length; private double width; public Rectangle(double l, double w) { length =

  • Group by - How to merge repeated values in reports?

    Hello, I am trying to build a report in OBIEE 10g using sum (AmountSold by CalendarYear) in one of the columns. The result is this: [http://postimage.org/image/2gvvw8qv8/] What I really need is to "merge" together the repeated columns by year, so it

  • URL link disappears in GIF

    I'm trying to put 3 links (Fcaebook, Twitter and Company's homepage) into an animated ecard (GIF). When I save for web is working perfectly, but when I try to paste the GIF into the email body, the links disappear. It's like the whole area where the

  • Re. Kodak Easy Share photo software, PC running Windows XP

    My iPad "giftee" hopes to keep her photo organization – folders, albums, events – intact when moving her photos on the iPad2. A trial export to her iPhone 3GS using iTunes lost all of that, resulting in several thousand photos randomly scattered in h