Design problem involving Wildcards and EJB-QL.

Could someone tell me if this is possible? (my syntax might be a bit off, but bear with me. It's the design I'm interested in, not the exact syntax)
signature="java.util.Collection findByFullMonty (java.lang.Float price, java.lang.Integer bedrooms... "*snip*
query="SELECT OBJECT(o) FROM Houses o  WHERE ((o.price =?1) AND (o.bedrooms= ?2) AND ... "*snip*I'd like to be able to use this query with wildcards as default values in a fashion similiar to this:
Float price = ??  ;//This is where i'm unsure, what is a valid wildcard for a Float?
Integer bedrooms = ??; // same here for Integer....
String realtorName = "*"; //i think this is valid wildcard for strings
*snip*
//if price supplied set price to input value
if (myObject.getPrice() != null){
    price = myObject.getPrice();
//if bedrooms supplied set bedrooms to input value
if (myObject.getBedrooms()!= null){
    bedrooms = myObject.getBedrooms();
//always use this finder using wild cards  unless a parameter is supplied
Collection c = findByFullMonty (price, bedrooms,  realtorName, *snip*); What i'm tyring to achieve is a single query that will work no matter how many of the input paramaters are supplied. Any supplied parameters are used, and those that are not supplied will use wildcard instead. I don't want to make a seperate query for every possible permutaion of supplied input parameters. Can this be done? If so, am I even close or out in left field? Is there a design pattern I should look into for this problem?
Thanks for any help guys!
(sorry for the cross-post, i didn't realize this was the approprate place until afterwards)

Yes, that makes sense, but the EJB-QL statements and finder methods in the home interface have to be defined at deployment time, correct? Once it is deployed, I can't dynamically create the EJB-QL statements and finder methods that are needed. That's the major hurdle I have right now.
Populating a big 'catch-all' query with wild cards and replacing them with supplied literal values is the only way I could think of to accomplish this dynamically. In my current work around I set a flag for each piece of data supplied. I then decide which (pre-defined) query is needed based on the supplied criteria flags. The problem is, I now have to have 2^n (n = number of possible input parameters) permutaions for the possible queries. For example: say i have: price, bedrooms and bathrooms. I'd need queries for the following cases:
1 price supplied only
2 bedrooms supplied only
3 bathrooms supplied only
4 price and bedrooms
5 price and bathrooms
6 bedrooms and bathrooms
7 price, bedrooms, bathrooms
8 nothing supplied (return everything)
Obviously this is going to break down really fast as the number of input parameters climbs.
Should I look at using some kind of JDBC code directly to build a query as I go? It seems like I am either approaching this the wrong way or missing something really obvious.

Similar Messages

  • Problems deployment servlet and ejb

    Hello,
              I'm Having the following problem hopefully someone can help me.
              I'm working in a visualcafe 4.5 project and I have to external jar
              files
              one containing an EJB the other cotaining some classes.
              testservlet.war : deployed by VC
              ejb.jar
              xxx.jar
              Deploying from VC is no problem but when I want to start the
              server it can not find some classes which are in the xxx.jar file
              containing the classes. But when I open the xxx.jar I see that they
              are located in WEB-INF/classes.
              My first Idea is that it could be a classloader problem
              In the startweblogic.cmd I add the testservlet.war to the classpath
              (Project options)
              In the ejbc additional classpath entrys of the testservlet.jar I add
              the xxx.jar.
              In the server additional classpath I added both ejb.jar and the
              xxx.jar
              can someone tell me where it is going wrong???
              Thanks
              Oskar
              

    Depoly them both in an EAR file. You will have to edit the Class-Path: property in each of the MANIFEST.MF files to make the proper path to the Singleton visible to all three, as well.

  • Really, really weird problem involving iPhone and Exposé

    Hey Mac users, try to figure this one out, this started happening to me today:
    My iPhone is rarely near my Mac Pro, but today I set it on top of my Mac Pro to let it charge. When it's connected to the Edge network, and there's network activity, I get the usual "beepbeepbeep" through my system's speakers, except now there's a twist. Whenever I hear the network activity interference, Exposé on my Mac Pro flips out, and acts as if I pushed the "Show/Hide Desktop" button a whole bunch of times. It stops when the activity stops.
    It's not reproducible all the time, and only happens every once in a while. But it definitely only happens during Edge network activity. I've never gotten it while in 3G or Wifi modes.
    I am guessing that the Edge signal is interfering with my Apple Bluetooth Keyboard, or something. I don't have any keys mapped to "Show Desktop," though.
    If anyone has any thoughts on this, I'd love to hear it. This isn't a really big problem, I just keep my phone away from my Mac Pro now.

    If you go into settings - general - about it will give you the version, the latest one is 2.0.1. Updating your phone may solve the problems. Failing that, take it to your nearest Apple store for advice.

  • Problems Involving text and FCP

    I'm working on of the motion templates and the text that I am adding in motion, when I open the same project file in FCP the same text gets moved and is no longer in the same position.
    http://img685.imageshack.us/img685/4611/screenshot20100225at914.png
    This is a screen shot of what I am talking about. Notice the light blue text (Usion T(X)ENTY) is no longer in the same location in FCP as it was in Motion. Besides this I have noticed no other differences so I'm thinking it has something to do with the text. Thoughts?

    hi,
    I sometimes get this kind of issue with fonts moving or not looking right in fcp or on export. I can cure it by building the effect in a different way. For example applying as fade behaviour will sometimes result in a pixel shift of the text in and out of the fade. But if i manually keyframe the opacity of the text its all fine. Sometimes shifting effects to parent layers and clicking their fixed resolution will cure it as well.
    hth
    adam

  • RE: design patterns involving EJBs and JDO

    Is the idea that you specify in some config file (xml?) the methods of
    your session bean, whether its stateful or stateless, the default bean
    transaction semantics, etc, then say "go" and it generates the home and
    remote interfaces and the skeletal session bean class?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:26 AM
    To: JDO-ListServ
    Subject: Re: design patterns involving EJBs and JDO
    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----
    From: Matthew <mailto:[email protected]> Adams
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated.
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric

    I don't think it's publicly available yet, I used to work there and was
    helping out a little with testing. I'll tell you in advance, it really
    works well. Much like the JDO implementation, the process of turning
    things into SesisonBeans is very transparent to the developer. I guess
    TT is going to make it available in another week or two, as time
    permits.
    ----- Original Message -----_
    From: Matthew <mailto:[email protected]> Adams_
    To: '[email protected]' <mailto:'[email protected]'>
    Sent: Monday, June 25, 2001 11:18 AM
    Subject: RE: design patterns involving EJBs and JDO
    IMHO, JDO replaces entity beans, but you'll have to decide for yourself.
    My recommendation would be to use session beans exclusively.
    Where do you get TechTrader's "SessionBean Creator"? What are its
    features? How do you use it?
    -----Original Message-----
    From: Eric Lindauer [mailto:[email protected]]
    Sent: Monday, June 25, 2001 8:12 AM
    To: JDO-ListServ
    Subject: design patterns involving EJBs and JDO
    Hi,
    I was just wondering, if you are using JDO for persistence, does it
    matter whether you wrap your objects with proxy EntityBeans or
    SessionBeans? I am currently demoing TechTrader's SessionBean creator,
    which makes means that for me creating SessionBeans is much easier than
    creating EntityBeans. I am currently using stateful SessionBeans to
    wrap the JDO objects, simply dropping them when the bean is passivated
    and refinding them ( they'll already be in the cache ) when the bean is
    activated._
    My main advantage in doing it this way is SessionBeans are so much
    easier to create. Do you see any problems looming, or any other
    advantages to this decision?
    Thanks in advance.
    Eric_

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fi

    I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fix"?

    Go here Mac OS X Yosemite (10.10) compatibility FAQs | CC

  • Designing DCs project and EJB- What is the right thing to do?

    Hi:
    I have a big doubt about designing DCs project and EJB:
    My presentation layer is WD and I'm going to use EJB Session and Hibernate to persist data. So I'm not complete sure how to model it at project level (I'm new on DCs projects):
    1- Did I have to make a DC project with a EJB Module project, other DC for Enterprise Aplication Project and other DC for a Web Module Project ?, if it so...must be one father and the others childs?
    2- Can I use only a DC-EJB Module and consume the project in my DC-WD? (I think that this is the right one but my project don't generate a deployable file....so begin wandering if the choice 1 is necessary....or something is missing... I expect a sda if not a default ear or war)
    3- Other (any idea?)
    I can't find any tutorial or good practice about it.
    Thanks a lot for your time on this thread.
    Rocío.

    See the tutorial Using EJBs in Web Dynpro Applications.pdf

  • Problem with In Design CS6 Unexpected Quit and will not re start up, even after computer restart?

    In Design CS6 Quit Unexpectedly and will not start back up, even after restarting computer.  Tried to do a CS6 re-install. It finished and said ready to use, but still getting same Unexpected Quit and In Design will not work.  Did not "Un-install CS6 first" Should I try installing CS6 again, un-installing version on computer first?

    Hi Ivesprepress,
    You might also try resetting your user preferences
    You can delete the replaceable InDesign SaveData and InDesign Defaults files by holding down the following keys while InDesign is launching:
    Windows: Shift+Ctrl+Alt
    Mac OS: Shift+Control+Option+Command
    Taken from: InDesign preferences and support file locations
    - Dave

  • What is the diffrence between a javabean and  EJB

    hi!
    what is the diffrence between a javabean and entreprise jvaabeans! i mean which are the uitilization featires of eaxh one !

    i am seeking for a solution for my problem , in fact i ma trying to implement and develop an application with java that allows a certain range of IP adresses to be connected to a database server in order to extract the suitable data from the server .
    let me explain mor ethe suitation , in fact what i am loking for is to use javabeans to grant my application much more consistence and pertinence : si i am asking if it could be possible to use javabeans in my case especially if i am not trying to developp a web application but a cleint /server one allowing some services.
    The application is in fact dealing with a stock exchange market and what i am trying to do is to grant particilar registrated customers to have the informations that they need ( portofolio, currency's status, market indicators, .) also drawing some charts decribing rates, variations, and others specefic financial caracterestics .So , if we consider that this application is not a web application ( no HTTP request and no servers like apache or others ) how it is possible to use javabeans and not EJB to build the application? i mean what could be suitable and preferable to rely on and dvelop to ensure a good java application !!
    if you need more details to help you find the answer for me don't hesitate to answer me back !!
    Someone here gave me that answer
    use RMI to code the services and (Updateable) Value Objects to pass the information between tiers.
    RMI is an all-java distributed component framework (ie. EJB, CORBA, DCE/RPC, DCOM, etc.), that is very suitable for developing non-containerized multi-tier applications. Refer to the RMI trail in the Java Tutorial as a starting point for coding RMI solutions (http://java.sun.com/docs/books/tutorial/index.html). Under this scenario you would code the database access service as an RMI service (server-side). Client/server communication should be facilitated through the use of JavaBeans/classes that wrap the information being passed (customer information, portfolio details, market information, etc.) - these are refered to as 'Updateable Value Objects' (a design pattern). Graphing and charting would be handled in your client from the information received from the (RMI) server. GUI JavaBeans can be used to provide this functionality as well as other client-side services. There are numerous "shrink-wrapped" components for GUIs available on the market just peruse any Java magazine to find them.
    but how comes? how can i do it !! and where can i find more information please about 'Updateable Value Object "
    thanks

  • Design problem about repreatable entity relationships

    Hi all!
    As I design the data model (let's name it the ERD, no matter the name is quite unfashonable), I have found almost identical structures of entities and relationships between them, but playing completely different roles in the semantics of the model.
    It obviously makes no sense to implement all such entities separately as the Entity EJB as they are to share most of the fields and methods, but I found no "handsome" solution when trying to implement them as sets of classes and interfaces forming "the abstract EJBs", and then by putting the conrete classes and complementary interfaces at the final packages to create "concrete EJBs". The problem was about types returned by the createXXX and findXXX methods, because they had to return the "abstract" EJBs but the EJB programming contract forces them to return the "concrete" ones, that are unknown to me when defining the "abstract ones". So it cancels the sense for creating them this way. It was also unclear how to operate the relationships in such model.
    The idea was:
    1. I define BaseSthLocalHome extends EJBLocalHome
    2. I define BaseSthLocal extends EJBLocalObject
    3. I define BaseSthBean implements EntityBean
    ... this way I have the "abstract bean", and then I can create many:
    SthOneLocalHome extends BaseSthLocalHome,
    SthOneLocal extends BaseSthLocal,
    SthOneBean extends BaseSthBean ... to have the first "concrete" EJB,
    SthTwoLocalHome extends BaseSthLocalHome... and so on to create the second, third and all the next "concrete" EJBs.
    Anyway, it did not work fine as I defined createXXX and findXXX methods at the BaseSthLocalHome interface - it made sense, because those methods did not depend on the other entities.
    Has anyone some idea of how to solve the design problem? Currently we are at very beginning of the project, so we have some "case study" time, and I would appreciate any solution: redesign of the data model, extraction of new EJB modules or any use of the objective inheritance.
    Thanks in advance!
    Marcin Gawlik

    Again me - I now it is a bad idea to reply for own messages, but I have just checked a new idea:
    The problem was about re-using the same components in different roles. I tried to do that by creating subclasses of the EJB classes, but it did not work. So I tried to define multiple entity EJBs that have the same class.
    Considering the given example, it would look:
    1. public interface BaseSthLocalHome extends EJBLocalHome
    2. public interface BaseSthLocal extends EJBLocalObject
    3. public abstract class BaseSthBean implements EntityBean
    ... then I created the deployment descriptor that deploys this pack of class and interfaces as three separate CMP Entity Beans:
    1. deploy BaseSthBean as the SthOne CMP entity EJB
    2. deploy BaseSthBean as the SthTwo CMP entity EJB
    3. ... and so one
    The question is: IS THERE ANY CONTRA FOR THIS WAY OF DEPLOYING EJBS? Is there any reason for not to use the same class and its complementary interfaces many times to create many separate enity EJBs working within the same EJB module?
    Thanks in advance!
    Gaw

  • Design problem/Ex​ercise Book

    Hi Everyone,
                       I am new to Labview. I just started with Labview 2011 student edition and I am following Bishop's book. But I also want a tutorial book with lots of design problems and exercises to get my skills. I am a postdoc in purdue and I started learning LabViews just because I want to learn (I am facinated by the G programming. I use it in my instrument but the departmental engineers wrote it and I want to have the same type of skills. I am also intending to become CLD). Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    Solved!
    Go to Solution.

    Ekram wrote:
    Hi Everyone,
                       I am ...Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    You found it!
    Get involved answering questions (gird up your loins) and let others hammer you into submision. Don't fall into the trap of writing code and posting VIs on demand, but rather post images of how you want to solve the posted question and let others feedback.
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design problem with Swing

    Hi all. I've run into some design problems when trying to create a Swing app.
    I've got a non-graphical class that emulates a power supply unit. Let's call it PSUnit. I have to create a GUI for PSUnit.
    Every class designed to build a full GUI app uses PSUnit in some way (changes its voltage, displays voltage, turns it on, turns it off, etc.)
    Here's the catch. Suppose I've got a class:
    public class BuildingBlock extends JPanel {
         // code includes a JTextBox displaying
         // the current PSUnit voltage.
    }another class is created for setting the voltage:
    public class AnotherBlock extends JPanel {
         // this class contains a JSpinner and
         // a button that retrieves the JSpinner value
         // and sets it as the current voltage of
         // PSUnit
    }When the button in AnotherBlock is clicked, I must notify the BuildingBlock class that a PSUnit has changed its state so it can update it's values and display the correct data.
    I've tried to do this a few times but failed miserably, so I'm hoping you guys could help me out.
    Please note that both of the above classes have some additional code and it's not very pleasant to make one class an inner class of another. I should be able to create a "standalone" classes which, combined together, form a GUI for PSUnit.
    Thanks.

    Yes this is a common problem that many of us have when building UIs
    Here's the question: In this instance, are these two classes really independant? Could they stand alone? Often when building a GUI, it's not even that easy to answer that question, but these leads to the two ways you can solve this
    #1. Make them independent, and use listeners either using Observable / Observer or creating your own custom listeners. The advantage of this is smaller classes and more independence. The disadvantage is it's generally more complicated, especially at the design stage
    #2 (what I'd probably recommend). Make 1 GUI class "MyPSFrame", then declare your panel classes as inner classes within that class. This way, everything goes into one spot, and everything is shareable. This also makes sense if you can't have 1 of the panels without the other.

  • Design Problem: Object reference another object at different states

    Hi,
    This is a problem I came across today while developing a simple prototype. Imagine I have a class Boy which has a one-to-many relation with a class Dog.
    The class Boy has the following methods: getName(), setName(), getAge(), setAge(), getDogs().
    The class Dog has the following methods: getName(), getOwner()
    When the application starts I load a Boy from the database as follows:
    Boy peter = BoyFactory.loadBoyByName("Peter");
    peter.setAge(10);
    I then add peter to a static list which can be accessed from everywhere within my application.
    At a different stage in the application I want to load a dog (just a dog). So I use the following code:
    Dog dog = DogFactory.loadDogByOwnerName("Peter");
    The dog object (using JDO or Hibernate) would also have a reference to the Boy object. However when calling the getOwner() method, the boy returned will not be the same boy stored in that static list (I expect the age, which was not persisted in the database, to be different).
    Is there a way how when loading the Dog object, since its Owner of type Boy is already loaded in my object model, a Framework such as Hibernate or JDO will use this object rather then re-build a new one.
    I am planning to use either Hibernate or some JDO framework and that is why I am asking this question.
    If I where going to use some custom made way to load Dog then I would just search if the Owner was in that static list and if yes then set the owner of the dog equal to the object found in the static list.
    However I was wondering if there is some design I should consider (study) to handle such a problem.
    Thanks and Regards,
    Sim085

    Thanks uj :) I had another thought...
    I will give another scenario so things are more clear.
    Imagine having a class Teacher which has one-to-many relation with a class Student.
    If you where programming the classes for these two entities then would you program the student class as follows:class Student{
    Teacher t = null;
    void setTeacher(Teacher t){...}
    Teacher getTeacher(){...}
    }ORclass Student{
    int teacherId = -1;
    void setTeacherId(int tId){...}
    int getTeacherId(){...}
    }The difference between these two methods is that in the first method, if I wanted to know the teacher of a student then I would only have to call the getTeacher() method while using the second design I would first need to get the teacher Id and then make a database call to actually get the Teacher object (or else get it from a static list where the teacher could be saved.
    Personally I prefer the first method since I like to have an object model where objects are directly linked with other rather then linked through some form of id. However I do not know which design is best to use...
    Thanks
    Sim085

  • Design problem: Central MessagePool in WebDynpro App.

    Hi people,
    I have a design problem in my webdynpro application:
    I'm designing an application with different DC's. The architecture of the application is similar to the architecture described in the document "Web Dynpro Component
    Interface Defintions in Practice SAP NetWeaver ’04s": One root DC which manages the differnt child DC's, which contain the application content.
    Now I want to have a central MessagePool. Certain Messages in the child DCs are the same, and I don't want to have multiple MessagePool-entries for the same Message (each child DC has to define its own messages).  I can't  use the root DC as central MessagePool, because the Child DCs havn't access to the root-DC.
    Any idea, how to define and use a central MessagePool?
    Regards,
    Thomas

    Hi Thomas,
    Instead of the architecture what you are thinking try the architecture explained in the following link:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f4d79e59-0601-0010-0689-89670315bc6b">link</a>
    Dont forget to award points on helping answers
    Regards
    sid

Maybe you are looking for