J2EE design

Will this tool support the design / build of EJBs or is it only aimed at webApps

Based on the following quote from there news article on java.sun.com I believe it is primarily a tool for RAD web applications.
Sun Java Studio Creator (formerly known as Project RAVE) delivers these benefits and helps you to create two-tier web applications that conform to the Java 2 Platform, Enterprise Edition (J2EE) BluePrints.
Regards,
Mark Wolfe
http://www.hsd.com.au

Similar Messages

  • JavaBean Models, Command Bean and J2EE Design Pattern

    Hello,
    I have read the available "How To", “Using EJBs in Web Dynpro Applications” where the author mentions that one should use a Command Bean (according to J2EE Design Patterns) so that one can invoke business methods in a Session Bean from our Web Dynpro Application. Well, although, I have read some available articles in the internet about J2EE design patterns, I still have some questions about command beans and its usage in Web Dynpro applications.
    I have developed a WD App which uses EJBs to read data from the DB.
    Let's suppose I only have two tables: BOOKS and AUTHORS.
    Let’s also suppose I have to Entity Beans (one for each table) and a Session Bean with two methods: Book[] getAllBooks() and Author[] getAllAuthors();
    I also have a Command Bean which I imported in my WD App.
    My questions are:
    How should I design my Command Bean?
    Can I have only one Command Bean with two methods each calling one of the methods of the Session Bean?
    Or instead should I design two Command Beans, one for each call?
    In the last case do the methods must be named <b>execute</b> or can I name them whatever I want?
    Furthermore, how should I store the data in my command bean? In instance variables?
    If so, can I use array of a class representing a record in the database table (for instance, classes Book and Author) or do I have to store the data in a generic collection (such as ArrayList for instance)?
    I ask this last question because if I try to store the data in an array when I am importing the Command Bean as a JavaBean model I always get an error.
    One last question: Can the Command Bean execute method directly return the data or should I always store the data in an instance variable an then get it using getter methods?
    I know this questions are more about J2EE Design Patterns and JavaBeans specification than they are about Web Dynpro but I also have doubts about the rules that the command bean must obey in order to accomplish a successful JavaBean model import in WD.
    Some guidance or tips would be highly appreciated.
    King Regards

    I have the same problem.
    Does anyone know the solution?
    Thanks
    Davide

  • Suggest good book for J2EE Design Pattern.

    Is there any good book for J2EE Design pattern? I know Head First Design Pattern book, but is focuses oncore java. I want to learn in detail with examples J2EE design pattern.
    Please suggest good books.
    Thanks in advance.
    Rahul.

    most j2ee patterns are discredited now. they were mostly workarounds for deficiencies in ejb 1 & 2 specs.
    "core j2ee patterns" is your best bet, but take it with a grain of salt.
    better to learn spring, IMO:
    springframework.org
    %

  • J2EE design patterns vs SAP component model

    Hello,
    does anyone have documentation or articles which makes a link between the J2EE design patterns and the SAP component model ?
    Thanks

    Hi Thierry,
    > What do you mean by assembling DC's into another DC ? Do you mean by using child DC's? Also , the J2EE server DC will have to be in a SC.
    If you create "Java" DC that DC will not have a deployable result on its own. Typically you create a public part with purpose "compilation" (API) and a public part with purpose "assembly". If you define a dependency from an EAR DC or a J2EE Library DC to that assembly public part then the Jar file contained in that public part will be assembled into your (deployable) .ear file or the J2EE library.
    Child DCs are just a means of limiting visibility/scope, similar to ACLs.
    As long as you are working with a "track" each and every DC will be part of an SC. You define a track, you add "developed" SCs, you get a "compartment" where you can create DCs. So each DC automatically belongs to an SC. (But not all DC types produce deployable results, EJB Module/Web Module also need to be assembled into an EAR).
    > is it typical to have an SC dedicated to utility classes?
    Depends on the size of the project/product. I'd start by putting utility classes into some utility package (pure Java). If that gets too large I'd put utility classes sorted by functionality into DCs (Java libraries = jars). If that gets too large its time to think about utility SCs. Otherwise the tradeoff between meta-information and real content might be too much. As the project/product grows the need for refactoring may arise...
    Regards,
    Marc

  • J2EE Design Questions

    Please forgive me, I am just getting into J2EE and, despite having a mountain of manuals on my desk, I'm having a little trouble figuring out how everything fits together...
    Question 1.
    Is there any standard application entry point for an EJB container... kind of like main() in a plain old java application, or the contextInitialized() method for a ServletContextListener in a web container?
    Question 2.
    Is there any kind of an analog to web.xml for EJB containers? If not, is there some kind of standard way to set initialization parameters for EJBs?
    Question 3.
    Is there any kind of JNDI service provider created for me by my EJB container? For example, the (rather old) article here:
    http://java.sun.com/products/jndi/tutorial/getStarted/examples/naming.html
    suggests the following code:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
        "com.sun.jndi.fscontext.RefFSContextFactory");
    Context ctx = new InitialContext(env);specifically 'Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"' looks like a bunch of voodoo to me, and also mentions something about the file system... I don't want my JNDI to have anything to do with my filesystem. Do I need to install some kind of JNDI server or LDAP server or something? Sorry... I'm really confused.
    Question 4.
    In my test application, I'm trying to centralize logging. I have a stateless EJB that implements logging capability. When instantiated, (in theory) it should register it's logging element to JNDI, so that further instantiations of the logging EJB should all direct their calls to the same element.
    I fully realize that this would imply (at best), in a distributed environment, the rather strange behavior of logging calls bouncing around to the first machine that happend to instantiate a logging bean...
    regardless, I have the following broken code:
    import javax.ejb.Stateless;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    @Stateless
    public class LogEJB implements VCMarkWeb.log.LogEJBRemote {
        private transient Context context;
        private transient Log     log;
        private transient boolean logMaster = false;
        private int logLevel;
        public
        LogEJB() {               
            try {
                context = new InitialContext();
                Log     globLog = (Log) context.lookup("log");           
                if (log != null){
                    this.log = globLog;
                    return;
                log = new LogWindow(800, 600, "LogBean", 5);
                log.out("Logging born.");
                context.bind("log", log);
                this.logMaster = true;           
            catch (Exception exception) {
                System.out.println("LogEJB: Exception while instantiating.");
                System.out.println(exception.getMessage());
        public void
        finalize() {
            if (!logMaster)
                return;
            try {
                context.unbind("log");
            catch (Exception exception) {
                System.out.println("LogEJB.finalize(): Exception unbinding log.");
                System.out.println(exception.getMessage());
    } Obviously, this code is broken, because my EJB has overridden finalize(), which is apparently not allowed. In this case (since I'm going to have to delete that finalize() method), how could I assure that my reference to a logging element will be unbound once the owner of that logging element is garbage-collected?
    ..or.. if I'm asking Question #5 in too convoluted of a way...
    Question 5'. Say, when my EJB container is kicked off, I want to create a single class containing a swing window, which will exist for the lifetime of the container, to which I can pass a handle to, such that any EJB's can invoke its methods? How would I do that, and how would I pass to my EJBs a handle to said class the 'right way'(tm)?
    Thanks so much for your assistance, J2EE design gurus :)

    singletons are counter to the very concept of distributed computing, which EJB is of course liable to do.
    So while you may have a class that behaves like a singleton inside its own enterprise application context, there is no guarantee it will behave like a singleton when seen from the perspective of a client.
    In fact, when the enterprise application is run in a distributed environment it's guaranteed to not be a singleton anymore as each JVM instance will have its own instance of the class loaded.
    It can get even worse depending on application server architecture, and you may end up having several instances of your "singleton" running inside the same server (possibly the same application) though that is more rare.
    So the best thing to do with singletons is forget all about them.

  • Some J2EE Design Questions

    Hello All,
    1. How can a daemon process/service implemented in J2EE world? Any design pattern?
    2. Is there any way to trap J2EE client disconnect events - we want to timeout
    user sessions if they fail to logout properly from our J2EE app and disconnect
    from App Server
    Thanks in advance for your time in helping me with these design issues.
    MS

    I have the same problem.
    Does anyone know the solution?
    Thanks
    Davide

  • HTTP GET/POST: J2EE Design Strategy w.r.t servlet implementation

    I am in process of designing a J2EE application with browser interface. I have thought of having "Front Controller" Servlet for all HTTP-GET requests and "Action Controller" servlet for all HTTP-POST requests.
    I have worked this distinction on the basis that GET request maps directly to page being requested and POST request corresponds to action being performed on some page. Here in fact the design is driven by appropriate selection between GET or POST. So all possible requests on the site should get properly mapped to action or page.
    Decision of two servlets is merely to divide the load on single servlet. There being well defined logical (page and action) and implementation (GET/POST) boundary, the division seems workable.
    Before actually finalizing this decision I need to know any inputs (pros and cons) of this approach.
    Further If I start mapping to actual scenerios,
    Request for home page,
    Request from HREFs,
    Request where new transaction is started
    will always be GET Requests.
    However what about request method (POST or GET) for update employee profile page when emp. id is available already available on first page ??
    And further
    Is this GET/POST divison always possible ??
    Any constraints that any one can see in this mapping ??
    Any comments on the update employee profile scenerio - GET/POST - page/action ??
    PS: Pl. discard error scenerios for the moment.

    how would you direct the GET requests to one servlet and the POST requests to the other?
    Wouldn't they need to pass thru' yet another servlet to decide which is which (GET or POST), and redirect them accordingly?
    I would have both GET and POST handled by the same single-point-of-entry servlet. For example, not all data is sent to the server via a POST - you can send form data via a GET, using name/value pairs in the url.

  • J2EE Design Approach

    Hi folks,
    I am not new to Java, but new to J2EE. I would like to tap your creativity for suggestions for a design approach. Basically, I would like to create a basic JSP/Servlet-based web application that interfaces with an Oracle database. I would like the JSP pages to be almost completely bereft of logic (i.e. use HTML and JSP tags only), with one or two very small snipplets. I would like the servlets to serve as "traffic cops"; that is, state machines that merely redirect to JSPs.
    My most pressing question is the following: as with one of my last J2EE projects, I would like to create a 'DatabaseManager' class. This class would basically "wrap" the JDBC calls to establish and maintain a connection, as well as provide convenient methods for querying (i.e. have a method that simply takes in a String represting the query), and returns back a data structure (another class) that wraps the "ResultSet" object (I'll call it "QueryResults", for now).
    Should the DatabaseManager and/or QueryResults classes be EJBs?
    Thanks!
    Tom

    Use of EJbs would depend on the scalability , security of your application.If yours is a very small scale application with 10 - 15 users , EJbs wont be a better choice.However if you need to set variety of security constraints like method level privileges and all , you can go for them.Also complicated transactions should encourage you to use EJbs.
    Just a thought.
    thx.

  • J2EE Design Question -- Am I On The Right Track?

    There are multiple tables in my database. Each table has a primary key, and the table that relates to other tables has foreign keys. I have to match the primary key and foreign key to go from one table to another. The specifics are spelled out below:
    The first table has login, pwd, and a primary key as fields, the second table contains completely different fields plus a primary key and foreign keys. The fields in the third table are different from those in the first and second tables plus its primary key. Queries to the third table can be made only if the user login and pwd are found in the first table, and through the second table's relation to the first table and the third table�s relation to the second table.
    The fields of all those tables may be accessed concurrently, but the fields are read-only (for the time being).
    I have a servlet to handle browser interactions. And I have a session bean to handle the workflow and business logic. However, I am confused with the choices between VO and entity beans.
    I first thought that I should use value objects to represent the data fields of the specific rows I looked for in those tables. Here is what I read about Value Object:
    "If a business object merely represents a structure to hold data fields, and the only behavior it provides are get and set method for the fields, then it would be wasteful of system resources to implement it as an enterprise bean. To avoid expensive remote methods calls (system resources and network bandwidth) to get the value of entity object fields, a value object is used to represent the details of the entity object. Only one remote call is required to retrieve the value object and then a client�s request to query the state of the object can then be met via local get methods on this details object."
    On my second thought, I think I should use entity beans to represent the specific rows I am looking for in those tables because I must use primary key and foreign key relations to go from one table to another.
    I do not use DAO because I am using CMP. The first call is within the session bean. It is a remote call to look for a specific row in the first table in my database. Subsequently, the mapping of the row in the first table to the second table, and the mapping of the row in the second table to the third table are all invoked on the �local" interfaces of those entity beans.
    client(browser)-->front controller(servlet)-->session facade(session ejb)-->entity ejb-->entity ejb -- > entity ejb
    Please advise if this is the right design. Am I on the right track? Is there improvement to be made?

    I might not explain my question well in my previous post -- there is no business logic involved in what I am doing to go from the first entity bean to the second entity bean and to go from the second entity bean to the third entity bean.
    Based on the login information, I have to go through those entity beans to find the very specific row in the third table in order to get the data field I need. That is to say, only thing involved is searching for rows.
    In my view, session bean -- > 1st entity bean -- > 2nd entity bean -- > 3rd entity bean
    1. session bean -- > 1st entity bean: remote call and returns the key to the 1st entity bean for locating the 2nd entity bean
    2. 1st entity bean -- > 2nd entity bean: local call and returns the key to the 2nd entity bean for locating the 3rd entity bean
    3. 2nd entity bean -- > 3rd entity bean: local call and then returns the value of the specific field to the session bean
    The alternative approach is:
    session bean
    |
    + + +
    1st entity bean 2nd entity bean 3rd entity bean
    1. session bean -- > 1st entity bean: remote call and returns the key to the session bean for locating the 2nd entity bean
    2. session bean -- > 2nd entity bean: remote call
    and returns the key to the session bean for locating the 3rd entity bean
    3. session bean -- > 3rd entity bean: remote call and the session bean can get the value of the specific field from the 3rd entity bean
    I do not know which approach to go for. Please provide guidance. Thanks.

  • Recommanded J2EE design pattern

    I have a program with the following design:
    one WebService
    which calls one EJB (Session bean).
    The EJB is calling one of 9 STATIC(!) methods (depends on parameter that webservice accept) which can call another static methods etc...
    I know this design is bad, and I want your recommended design for this application.
    I am getting an outOfMemory exception when i run a loop that calls this webservice for many time.
    Is there any design which may help me avoid this outOfMemory exception ?
    Again , please refer this:
    ** one webservice
    ** one ejb who calls to static methods - depends on parameter that webservice accept.
    Thanks

    Hi duffymo, Thanks for attentionHi George, it's my pleasure. Maybe we'll both learn something here.
    answers :
    1) its a stateless session beanVery good. Any private data members in that SLSB?
    2) The out of memory error happens when i am running
    the application from 150 clients repeatly as a load
    testAre you monitoring memory using a tool like JVMStat from Sun, OptimizeIt, or JProbe? I'd recommend it.
    How much memory have you allocated to the JVM? What are the -Xms and -Xmx settings? Have you tuned any other JVM settings for memory and GC?
    3) you say : "none of these objects can be GC'd" ,
    why is that ?A static object is associated with a class. Once a class is loaded by the JVM it's never unloaded. The static objects will remain in memory for as long as the class does.
    4) The stack trace shows an outOfMemory exception and
    can happen in any phase, after ~X times.(depends on
    free JVM memory).Objects aren't being cleaned up. You're hanging onto references, so the GC can do its job.
    5) I can't run a profiler on this machine because of
    a technical reasons.You can certainly run JVMStats. It's non-invasive.
    6) I indeed saw the perm space growing with systemout
    methods
    The big question is about the coding,
    1) is there anyway to improve this kind of code
    writing ? Undoubtedly yes.
    2) Will the GC run better if these methods would be
    running from a nonstatic source ? should i write
    classes for these methods and invoke an object for
    each call ? If the methods are all related, differentiated only by a parameter, why have nine objects? Why not one SLSB with nine methods?
    3) Should i write 9 SLSB and let the webservice
    decide which one to call ? or should i write one SLSB
    with 9 methods and let the webservice
    decide which method to call ? I'd try the latter.
    are the 3 questions above have anything with
    memory/GC performance ? I don't know without more info.
    %

  • J2ee design pattern

    what's the role of the handle in the business delegate pattern sequence diagram

    Hi,
    If I get it clear, the String version of handle can be used to reconnect the business service. An example can be found there:
    www.javapassion.com/j2ee/DesignPatterns.pdf
    Hope this helps.
    L.P.

  • J2EE design tools in NetWeaver

    Hi,
    Do we have any J2EE/WebDynpro deisgn tools as part of NetWeaver which supports UML kind of modelling ,object, class sequance diagrams etc?
    regards,
    Sujesh

    Hi 
    Check page-8 of http://www.xilinx.com/support/documentation/sw_manuals/xilinx14_6/irn.pdf
    The Virtex-4 device is supported in ISE 14.6 but ISE webpack only supports XC4VSX25 alone. You need to purchase ISE license to target the device XC4VSX55-10FFG1148C.
    Thanks,
    Deepika.

  • Simple J2EE Design patterns for newbies

    Hey
    I've managed to get a basic understanding of how J2EE web applications are put together. I've done some simple stuff like jsp's posting to servlets to do database inserts for example.
    In an effort to get a more well rounded understanding of whats going on I want to write a simple phonebook web app. As my previous adventures in web development have been php pages that mixed php and html. I really want to get away from the bad habits that people say PHP can encourage and get a proper MVC setup going. I'll describe my plan and then all you guys can rip it apart and hopefully in the process I will learn something Smile
    In the case of a user wishing to insert a new record. I imagine the process to be the following.
    JSP/HTML form that posts to a servlet, the servlet then uses a bean to handle the database interaction and once the bean has finished the jdbc work the servlet forwards the user to another jsp that displays the current contents of the table.
    So, for example I will write a bean that has 4 methods. One to read the full contents of the table, one to insert a new record, one to update and finally one to delete.
    Depending on what parameters are passed to the servlet via HTTP POST it will call the corresponding javabean method.
    Am I on the right track?
    Thanks

    Ok well this is what I have come up with so far
    Servlet
    public void doGet (HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
            out = resp.getWriter();
            String action = req.getParameter("action");
                String name = req.getParameter("name");
                String phone = req.getParameter("phone");
                DbWorker db = new phonebook.DbWorker();
                if (action.equals("insert")){
                db.doInsert(name,phone);   
                } else if (action.equals("delete")){
                db.doDelete(name,phone);   
                } else {
                out.println("you didnt ask me to do anything");   
                }  And the "Bean" it uses to do the database work is below. Note: The term java bean is used all in all the books and online forums I have seen. Whats so strange about its use today (just curious). Anyway the db stuff
    public void doInsert(String name, String phone){
            String query = "Insert into test(name,email) values(?,?)";
            try{   
                PreparedStatement stmt = con.prepareStatement (query);
                stmt.setString(1, name);
                stmt.setString(2, phone);
                stmt.executeUpdate();
            } catch (SQLException e){
            public void doDelete(String name, String phone){
                String query = "delete from test where name = ? and email = ?";
                try{   
                PreparedStatement stmt = con.prepareStatement (query);
                stmt.setString(1, name);
                stmt.setString(2, phone);
                stmt.executeUpdate();
            } catch (SQLException e){
            }  The code above works without any problems. However I now want to write a method to execute a select statement and I want it to be able to return the results to a jsp that can then iterate through and print out the results. My guess is that i create a method to return the resultsset array that a jsp page picks up by using the standard tag library to go through it and print out the results?

  • DAO J2ee design pattern

    Hi,
    I understood the structure of DAO pattern like : The business Object uses Data AccessObject which encapsulates the DataSource. The DAO creates/uses the Transfer Object and the BusinessObject obtains/modifies the Transfer Object.
    Can i get the sample code for this pattern and any links for the code.
    Thanks

    Hi,
    I understood the structure of DAO pattern like : The
    business Object uses Data AccessObject which
    encapsulates the DataSource. The DAO creates/uses the
    Transfer Object and the BusinessObject
    obtains/modifies the Transfer Object.
    Wrong.
    Can i get the sample code for this pattern and any
    links for the code.
    ThanksYou should be able to take it from there if you understood it that well. Too bad you don't
    %

  • J2EE Design Patterns

    If you don't have SessionFacade pattern implementation,is it possible to have a Business Delegate talking to a Session Bean
    Thanks in advance

    yes its possible

Maybe you are looking for