JDev 1013 BUG? EJB, CMR, DTO and session facade.

I've created two CMP Entity EJB's, CourseEJB and PupilEJB, and defined a M:N relationship between them. A course has many pupils and vice versa. Each bean has only two attributes, id (Long, part of PK) and name (String) for simplicity.
1. Generated DTO's for the two beans won't compile
I get error on:
public void addcourseEJBLocalDTO(courseEJBLocalDTO courseEJBLocalDTO)
coursesDTO.add(courseEJBLocalDTO);
courseEJBLocalDTO.setPupilsDTO(this);
and:
public void addPupilEJBLocalDTO(PupilEJBLocalDTO pupilEJBLocalDTO)
pupilsDTO.add(pupilEJBLocalDTO);
pupilEJBLocalDTO.setCoursesDTO(this);
because JDev has created definitions of the setCoursesDTO function like this:
public void setCoursesDTO(Collection<courseEJBLocalDTO> coursesDTO)
this.coursesDTO = coursesDTO;
and ditto for the setPupilsDTO method, taking a Collection as argument too.
I can fix this code manually, but next step, generating a session Facade with added methods for handling the entity beans isn't exactly any better...
One M:N relation is pretty basic, am I doing something wrong here?
Message was edited by:
jonmarti

Forgot to add, running on 1013

Similar Messages

  • Business delegate and Session facade design patterns

    Does any one tell me, what is the difference between business delegate and session facade design patterns.

    1. Session Facade decouples client code from Entity beans introducing session bean as a middle layer while Business Delegate decouples client code from EJB layer ( Session beans).
    2. SF reduces network overhead while BD reduces maintenance overhead.
    3. In SF any change in Session bean would make client code change.
    While in DB client is totally separate from Session bean because BD layer insulate client from Session beans(EJB layer).
    3. In only SF scenario, Client coder has to know about EJB programming but BD pattern no EJB specialization needed.
    4.SF emphasizes on separation of Verb, Noun scenario while BD emphasizes on separation of client(presentable) and EJB layer.
    Anybody pls suggest more differences ?

  • Service Locator and session facade pattern

    What are differences between Service Locator and session facade pattern?
    For me it seems one and the same.
    Please explain me in detail. Expecting kind help.
    Thanks,
    Rahul
    Edited by: rahulb1 on Feb 26, 2008 5:07 PM

    rdoekes wrote:
    The ServiceLocator Pattern is a singleton which hold a map of used DataSources. The idea is that you perform a lookup once and use the cache afterwards. The session facade is just one DataSource lookup.huh? Those J2EE patterns are not really reduced to datasources and the SessionFacade has actually nothing to do with datasources.
    Session Facade
    It has Facade in it and a Facade is usually used to give a simple entrypoint by providing a standartized interface. The same is now with the Session Facade. You have a Session bean that represents a high-level business component that interacts and calls lower-level business components.
    Imagine having client a accessing 5 business objects with the remote calls, which is not an efficient way (network latency) or accessing the SessionFace and the session face is doing all the work through local access.
    Service Locator
    As J2EE components are using JDNI to lookup for ejb interfaces,DataSources, JMS components, connections etc. isntead of writing all the lookup in many code piecess across the project, you write a service locator that gives you a centralized place to handle the lookup's. It's easier to maintain and to control such a setup.
    As you can see there's quite a big difference ;-)
    cya,
    Nail

  • Diferences between Business Delegate and Session Facade

    Hi, I've been programming with java for a long time now, but recently decided to formally studing the J2EE patterns. By now I have the intuition of many of them but in paper looks a little confusing. Let me ask you what is a clear diference between Business Delegate and Session Facade.
    For me, exposing interfaces, hiding implementations and masking the complex interactions in the back are common factors in these patterns, could you please help me to identify diferences?

    There are more subtle differences, but the basic gyst is that the Business Delegate is used on the client/presentation tier. The Session Facade is used on the server/service tier. The Business Delegate typically performs a lookup of the SessionFacade which in turn fronts a service method (EJB or otherwise). The Business Delegate pattern is typically associated with J2EE remoting and its shortcomings.
    - Saish

  • Business Delegate and Session Facade usage.

    Hi guys.
    I am new to JavaEE and I recently learnt the Business Delegate and Session Facade design patterns. The tutorials from Oracle did gave me a basic idea of what they are and why they are used, but the example didn't really answer all my questions. So I decided to use a real life scenario here and put my question in to it. Any help is appreciated.
    Assume I want to create a search employee page for my company, the employees are categorized by his or her department and the province he or she is in. I have in the database a look up table for department and province. (as shown in the image below)
    http://oi46.tinypic.com/idvpsl.jpg
    So I create three JPA entities, one for each table. Now I am stuck with what is the proper way to design the session facade design pattern. I know that I will need the to access all three entities in my page. (to get the drop down list for Provinces and Departments, and to retrieve list of Employees based on the selection) So should I create a Stateless Session Bean as session facade to access all three JPA Entities or should I create three separate Stateless Session Bean to manage one Entity each?
    I came up three component diagram in the below picture.
    The first one has one Stateless Session Bean as session facade and manages all three Entities.
    The second one has a session facade to manage the relationship between business objects such as ProvinceManagerEJB and DepartmentManagerEJB which will manage the corresponding Entities.
    The last one has three Stateless Session Beans that will manage one Entity each, all three Stateless Session Beans can be looked up via the Business Delegate pattern.
    http://oi46.tinypic.com/10pqets.jpg
    Please let me know if any one of them is the proper way to use business delegate and session facade. or none of them is correct. (which I assume might happen)
    Again, thank you so much for your help.
    Cheers
    Edited by: 992005 on 05-Mar-2013 18:15
    Edited by: 992005 on 05-Mar-2013 18:17

    Well I can't access any of your diagrams from here so can't comment on them. For dividing the functionality into separate classes, think about
    1.) Quantity - Are there many enough service calls to require splitting up or will one application service class be enough? The size of the system is important here.
    2.) Are you duplicating logic in the services? e.g save person, delete person in one service and save department, delete department in another e.t.c is better factored into one service with save entity, delete entity calls because the JPA entity manager doesn't know about the type anyway and it's easier to apply common logic (e.g logging auditing) around the calls.
    3.) Will each service makes sense on it's own or do you always need the other functionality to completely describe the service? Here it is important not think about entities but about the business use cases. Process1Service is better than Entity1Service, Entity2Service ... EntitynService.Think granule of reuse = granule of release. Only split out individually reusable services. A good way to understand granules of reuse in your system is to think about (or start by writing) test cases for the functionality. Testable code is reusable code.
    4.) Will the services change together? At class level you would look at common closure principle (classes that change together should be packaged together). You can apply the closure to the methods as well. Make it easy for future developers to recognize dependent functionality by packaging it together.
    These are just general because in enterprise development requirements are king. You can chose to follow or discard any of these rules depending on your requirements as long you understand the impact of each decision.

  • Facade and Session Facade

    All,
    Well this is the closet forum i could get to post my question so please excuse me if it is in wrong place.
    Can anyone mention the types of facade design pattern available ? Also what is the diff between Facade and Session Facade ?
    PS : My application is getting developed in ADF :)
    thnks

    in the line of fire wrote:
    All,
    Well this is the closet forum i could get to post my question so please excuse me if it is in wrong place.
    Can anyone mention the types of facade design pattern available ? Also what is the diff between Facade and Session Facade ?This is no really ADF specific. You may wish to consult both the "Gang of Four" book along with Fowler's "Patterns of Enterprise Architecture."
    A quick answer: the Facade pattern defines an object ( or method on an object) that executes a workflow involving other objects that you wish to hide from client applications or objects.
    A session facade is the same idea applied to JEE session beans, where a single call to a session bean may include interacting with other beans, entities, databases, etc.
    Hope that helps,
    Chad
    >
    PS : My application is getting developed in ADF :)
    thnks

  • (ejb 3.0) stateful session facade?

    Hello,
    (1) Would you consider stateful session facade (whose client is a servlet) a bad design?
    (2) How to have a stateful session facade referenced in a servlet? I am using Sun Application Server Platform Edition 9.0 and trying to make an injection:
    @EJB(name="ejb/KOGSessionFacade")
    protected KOGSessionFacade sessionFacade;
    but then I get this error in deploy-time: "A stateful session bean can not be injected into a servlet. Please refer to EJB 3.0 Persistence API Specification section #5.2 for further information."
    Thanks.

    Using a Stateful Session facade from a Servlet is not necessarily a bad design. In some cases, you may want to do some cleanup work on completion of a transaction. Stateful Session beans provide a convenient way (By implementing SessionSynchronization interface) to do this.
    In the servlet programming model, Servlets are not designed to be single threaded. So if you inject a StatefulSessionBean (SFSB) references then multiple threads could be possibly be invoking the SFSB concurrently. In this case, the EJBContainer (as required by the specification), will throw a well defined exception.
    What you may want to do is to place this SFSB reference into you Servlet session.

  • Business Delegate and Session Facade

    Business Delegate as well as Session Facade are used to reduce coupling between presentation-tier clients and business services.
    Could someone provide the key differences between these two patterns.
    And one more, is Session Facade applicable(can be implemented) only to Enterprise Java Beans? Or even a POJO can be a Session Facade
    Thanks in Advance

    Business Delegate as well as Session Facade are used
    to reduce coupling between presentation-tier clients
    and business services.
    Yes. And also in EJB to overcome some of the deficiencies in distributed architectures.
    Could someone provide the key differences between
    these two patterns.
    Business Delegate is used by a client whereas the Session Facade is used to abstract a business service.
    And one more, is Session Facade applicable(can be
    implemented) only to Enterprise Java Beans? Or even a
    POJO can be a Session Facade
    Yes. Think of a session facade as your 'easy' or 'high-level' API. Your actual business tier may have its own 'low-level' API that callers should not have to interact with or understand.
    Thanks in AdvanceYou're welcome.
    - Saish

  • Business Delegate and Session Facade Pattern

    Hi!
    The only way to use the Session Facade Pattern, is if I use EJB for Persistence.
    Is valid to do this?:
    I use Ejb for simple update, insert querys. From my business delegate I call the Session Facade Layer, and from this I invoque Entyties for persistence.
    But if I have complex querys, is correct to make PL SQL Procedures and do the following:
    From my business delegate I call to the Dao layer, and from this via JDBC I call the Procedure.
    Please explain me the best form to do this, having complex querys for reporting and simple querys for inserts/update.
    Is valid to combine the use of CMP (for simple persistence cases), BMP (for complex persistence cases), and JDBC for complex select querys with multiple result rows.
    Thanks!!

    It depends on your design goals. One of the forces driving the use of patterns is the desire to tier an application and abstract the internals of each tier away from the other tiers. One (normal) benefit of this methodology is that the application should become more portable. Now, if you are using PL/SQL, BMP and CMP, you are mixing and matching portable versus proprietary. This is okay. But you should abstract away whether you are using PL/SQL, BMP or CMP from the business layer (or domain model). Ideally, you could completely swap database technologies (say from relational to object) and only have to re-write your integration tier (your DAO's).
    Session facade is simply a glorified Facade pattern. It abstracts the lower-level details of what you are persisting and instead forces you to think in terms of objects. You can use a facade without even remotely touching EJB's. It just so happens that, historically, EJB containers made a mess out of scalability when it came to entity beans. The "session" facade refers to a facade pattern implemented in session beans (that have fewer scalability problems) communicating with the entity beans which do have scalability problems.
    So... to make a long story short, use whatever persistence mechanism you desire. Remember that you should be able to completely switch your persistent store from one type or another and simply re-write your DAO's (or CMP deployment descriptors). Using a facade pattern can help towards this end, but don't make it a straightjacket.
    - Saish
    "My karma ran over your dogma." - Anon

  • Value-list handler, value-list iterator and session-facade strategy

    Hello all,
    Further to an earlier post, I rewrote my post trying to me more accurate in my question.
    Here is my problem:
    I am trying to implement the value-list handler design pattern using the session facade strategy. In the pattern as it is described here
    (http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html) the client accesses the value-list handler AND the iterator directly.
    As I chose the session-facade strategy having my value-list handler as a stateful session ejb, I don't know how the client is going to access the iterator. I see only one option: Having the client access the iterator through the ejb value-list handler. This requires adding new methods to the ejb.
    Is this the correct way of doing it? Is there another way of doing this?
    Thanks in advance,
    Julien Martin.

    u can use project list handler as ur session facade.
    regarding ur second question ..session facade and value list handler session bean which is also a session facade( but there is difference between first and second) so u can use session facade and value listhandler

  • Depenency Injection and Session Facade in WebDynpro DCs

    Hi all,
    for the sake of decoupeling the business logic and persistence from the view i introduced a session facade.
    I wonder how to acess the session facade bean from my webdynpro?
    am i right that dependency injection inside a wd dc is not working?
    does jndi work in a wd dc?
    regards,
    christian

    Hi Christian,
    First - welcome to SDN!
    To your questions:
    1) JNDI access to EJBs works from any client application, which means also from WD apps. <a href="http://help.sap.com/saphelp_nwce10/helpdata/en/45/e692b2cfaa5591e10000000a1553f7/frameset.htm">Here</a> you can find more information on that.
    2) Dependency injection does not work within WD.
    3) I would suggest you to consider the <a href="http://help.sap.com/saphelp_nwce10/helpdata/en/45/f7f744aea471fae10000000a1553f6/frameset.htm">EJB Model Importer</a> which is the easiest and recommended way for using session beans inside WD components. This is a new feature coming with <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/ce">SAP NW CE</a> aiming to increase developers productivity by reducing the need for manually written code for accessing and calling the EJB business methods.
    Please do not hesitate to come back should you have any further questions.
    Best regards,
    Vladimir
    Message was edited by:
            Vladimir Pavlov

  • Flex and ColdFusion and session facade?

    I want to deploy a flex application on an existing ColdFusion
    server. This server is already in production and uses a root
    Application.cfc to set session variables as well as authenticate
    the user to AD with getAuthUser. When I deploy my flex application,
    it fails because of the OnRequestStart cfcomponent within
    Application.cfc. I am wondering if this would be proper use of
    session facade? How do I best encapsulate session variables from
    the root Application.cfc within my new flex application? Basically
    I will need to follow the same authentication and cfset session
    guidelines that all of my other CF applications use, and my flex
    app needs to have theses session variables available to it, but I
    am not sure the best approach. Any insight is welcome.

    Did you enable session management in the Application.cfc or
    Application.cfm?

  • DAO and session Facade

    Hi
    I came across an design pattern where they call the DAO from Session facade. The purpose of session facade is to minimise the number of network calls. Even though there are no network calls involved why do they go for session facade to call the DAO. Wont a DAOFActory will help them doin this.
    Even if the requirement is to block the presentation layer of all the backend operations, we could have had any other , why session facade was used i could nt understand

    You might even discover that entity beans can get created even before you use them.
    Your application server creates "pools" of bean instances that it can use when it needs to. It is part of this role, and is done in order to optimize performances.
    You cannot force them to be garbage collected. Even if you stop referencing them, the app server will.
    When your create references to a bean, it (usually) won't create an instance. It will take an existing one, and load data into it, using ejbCreate or ejbActivate.
    Hope this helps.
    /Stephane

  • EJBs only for session facade?

    Hi all,
    With EJB 2.1 many were saying that it is good to place POJOs behind a session facade of ejbs for a distributed application.
    This will allow a developer to test his business logic outside the container.
    But with EJB 3.0, all ejbs are pojos, so can i use ejbs for all my business logic?
    Is it advisable?
    Will this have any performance problem?
    Kindly suggest.

    Hi,
    Thanks for your reply.
    I have a distributed application with numerous web clients as well as a few multithreaded application clients accessing the business logic layer.
    Definitely there will be a huge load especially if the number of clients increase.
    So there will be a lot of distributed transactions.
    I have no doubt whether i should use ejbs or not.
    I must because the business logic layer must support remote access.
    Considering this scenario, should i use ejbs beyond the session facade layer?
    I understand that by using ejbs only in the session facade layer is an adavantage as that will not tie my business logic to a framework.
    But considering the scope of the application, kindly provide your suggestions.
    Thanks in advance,
    James.

  • Business Delegate, Session Facade or both?

    Hi,
    I'm having some problems with figuring out the point of using both Business Delegate (BD) and Session Facade (SF). As far as I can see, you often have a 1-1 mapping between the BD and SF, so why not use the SF directly?
    Here's my scenario. I have a web application that uses WebWork for presentation and pageflow, a session facade implemented using an ejb, which aggregates calls to the businness objects into "business rule"-methods and business objects implemented using plain java objects. Is there really any need to have a business delegate here? I might as well use the session facade directly from the webwork actions? Or..?
    Any suggestions? Am I far off? ;-)

    As far as I can see, you often have a 1-1 mapping between the BD and SF, so why not use the SFYou can have one Business Delegate encapsulate all of the business methods that are exposed by one or more Session Facades. The benefit here is that you protect the web component from any details of the business tier. e.g. your business tier has five session facades and the web tier has a single Business Delegate. The BD can be extended to call web services as well.
    Here's my scenario. I have a web application that uses
    WebWork for presentation and pageflow, a session
    facade implemented using an ejb, which aggregates
    calls to the businness objects into "business
    rule"-methods and business objects implemented using
    plain java objects. Say you eliminate the EJB implementation. What effect will this have on the web tier objects? The Business Delegate will enable you to easily replace the business implementation with little impact on the web components.

Maybe you are looking for

  • Commitment item error at the time of Service entry Sheet

    Hi experts, I have created a service PO, in which I have given the GL. Now when I am going to post the service entry sheet, I am changing the GL account. But system is picking the commitment item with reference to the GL earlier provided in PO. I wan

  • How to manage multiple exchange account calendars in Outlook

    the assistant of the VP wants to manager the VP's calendars on Outlook 2010,  so she can do a side-to-side comparison. VP has two exchange accounts, one is hosted locally(exchange 2007), and another one is on Office 365. these are two different compa

  • Referenced library

    Hi all, I'm trying to use a referenced library system, so when importing in a library I leave the photos on external hard disks (Store files: In their current location). In Aperture preferences I have not checked "New projects automatically generate

  • User Administration - Roles screen - Operation aborted

    Hi All, I'm having trouble accessing the roles page in the user administration screen of our SAP Portal. Internet Explorer keeps poping up a dialog box saying "Operation Aborted". This sometimes happens immediately, other times after a couple of scre

  • Apple, why not an in-app purchase for iPhone OS?

    How many people bought an iPhone3G last year and now likes to have some new software-features that are active only for the new iPhone3G-S, but thinks that his iPhone already works well and isn't the moment for spend more money for the new iPhone and