Help with Designing a Simple Database

I am currently working on a designing problem I would appreciate if someone could review my solution.
The Problem:
I need to create a simple database that contains the following entries�
First Name //mandatory
Last Name //mandatory
Date of Birth //mandatory
Hobbies //there could be anywhere from 0 to infinite amount of hobbies
Type of actions that I need to perform on the database�
Add, delete, and modify and entry
Below are a two design solutions I came up with�
For both solutions I am going to create two text files. One of the text files called profiles.txt will contain the following fields on each line�
Id, First Name, Last Name, Date of Birth
//the Id field in this text file will be the primary key so you will not see the Id duplicated
The other text file called hobbies.txt will contain the following fields on each line�
Id, hobby
//the Id field can be duplicated in this text file so a person can be linked to zero or several hobbies
Now what differs between my solutions is how I am going to read this data into my program�
Solution 1) When you start the program it will read the profiles.txt into a linked list. After that is finished the program will then load the hobbies into several linked list that the profiles linked list will point to. So basically each person will have a linked list of hobbies associated with him or her.
Problem I see with this solution is that if there were 200 million people contained in the profiles.txt would my program crash since the computer would not have enough memory to load all of those names?
Solution 2) Instead of loading the data at the start of the program the data will stay in the text files. So when someone does a search it will open the text file and search for the entry.
Problem with this solution is it would be hard to delete and modify names (would I have to rewrite the text file every time I do a change?). Would a good fix to this problem be creating a separate text file to keep track of any changes or deletions I do and once in a while do a database maintenance?
So a review of my questions is�
1)     Would my program crash if I had 200 million entries if I use my solution 1?
2)     Is my solution 2 possible without being incredibly slow or complicated?
3)     Is there another way of doing this I have not thought of?

I think having one option will do. Now the problem with this text file thing is that, we'll hve to read every information into memory if we are running a test driver for the program and then work on the information in memory.
After the program closes, whatever changes we made to this data in memory shd be written to file so we need to find a way of writing the data from memory to overwrite the file. I hope you kinda get what i'm talking abt.
the database will consist of information like this
String firstName
String lastName
String DOB
ArrayList / Vector Hobbies
Now, we kinda want to declare a class with with all these information as data fields ok.
so let's say
public class Try{
String firstName
String lastName
String DOB
ArrayList / Vector Hobbies
and then create an instance of this class in the driver
which will be an ArrayList of this class or something so each index of this class ArrayList will hve it's unique data information from the file we read in but again, this is kinda working in memory right.
After doing all we have to do, we want to write back to file all the changes we made to the data in memory. That's where we are kinda stuck right now.
A member of the group was suggesting we call whatever functions to work on the txt file which will mean we'll hve to re-write each time we call a function to operate on it and all that stuff. This is a slow process.
will be glad if anybody out there will have a better way to implement this. Thanks a lot.

Similar Messages

  • Help with Retrieve attributes from database

    Hi,
    I'm using filter "Retrieve from or write to database" with select query from database by selecting attributes as column names radio button.
    I'm unable to get these user attributes with column names.
    For eg : select tag from test_tag where rownum=1;
    I was trying so that result can be used using tag attribute (${tag}).
    Please help in this regard.
    Thanks,
    Vani

    Hi Vani,
    After the retrieve filter, add a Trace Filter and leave it as it is. Execute the policy once and in the trace data that now will be displayed there you should be able to read out the exact name and type of the parameter. This way of identifying data/parameters etc is a recommended way of working while developing! Copy paste the Trace Data from the Trace filter here if you need help!
    Cheers,
    Stefan

  • I need help with paginating my Oracle database records in JSP

    Please can someone help with a script that allows me to split my resultsets from an Oracle database in JSP...really urgent..any help would be really appreciated. I'm using the Oracle Apache http server and JSP environment that comes with the database...thanks

    First thing you have to do is decide on a platform and
    database. Check to see what your server supports. Whether it is ASP
    and MSSQL, PHP and MySQL or less likely Cold Fusion.

  • Help with ComboBox, datasource from database

    Hi there,
    i am new to Flex technology and desperately need help with
    combobox.
    I have a combobox in my app and the datasource comes from
    MySQL database. I use a PHP script to populate the combobox. Say in
    the datatabse table, I have the following result:
    id name
    1 dog
    2 cat
    3 horse
    In the app, the combobox will have the list as the name of
    the animals: dog, cat, horse. But when the user selects dog, how do
    I get the selected id 1 instead of the label "dog".
    Any help/suggestion will be appreciated.

    Hi again,
    the xml for the combobox datasource is as follows
    <animals>
    <animal>
    <id>1</id>
    <name>dog</name>
    </animal>
    <animal>
    <id>2</id>
    <name>cat</name>
    </animal>
    <animal>
    <id>3</id>
    <name>horse</name>
    </animal>
    </animals>
    and my <mx:HTTPService> is:
    <mx:HTTPService id="dropDown" useProxy="false" url="
    http://localhost/~ronnyk/combobox.php"
    resultFormat="e4x" result="get_drop_down(event)" />
    public function get_drop_down(e:ResultEvent):void{
    var dropArr:XML = e.result as XML;
    cb.dataProvider = dropArr.animal;
    cb.labelField = "name";
    cb.data = "id";
    public function clickme():void{
    txtinput.text = cb.selectedItem as String;
    I can't figure out which part I did wrong, in order to get
    the id instead of the name when the user clicks the button

  • Help with a very simple horizontal Spry menu

    Hi,
    I’ve always received great help here and I’m sure that if I explain the issue I’m having properly I’ll get some good input.
    This is to do with a very simple horizontal Spry menu, there’s no dropdown involved, only a color change on the rollover.  The menu items are in a shade of blue, then on the rollover each menu item changes to a shade of red, the font color remains white for both.
    What’s mentioned above works flawlessly, the problem I’m having is this … On the rollover when the menu block items turn red, I’m attempting to add a 1px border around the entire block, but when I do the block item seems to want to change its width and height slightly when it’s rolled-over.  As I said, without the border it works perfect.
    Any suggestions will be appreciated.

    steve0308 wrote:
    Hi,
    I’ve always received great help here and I’m sure that if I explain the issue I’m having properly I’ll get some good input.
    This is to do with a very simple horizontal Spry menu, there’s no dropdown involved, only a color change on the rollover.  The menu items are in a shade of blue, then on the rollover each menu item changes to a shade of red, the font color remains white for both.
    What’s mentioned above works flawlessly, the problem I’m having is this … On the rollover when the menu block items turn red, I’m attempting to add a 1px border around the entire block, but when I do the block item seems to want to change its width and height slightly when it’s rolled-over.  As I said, without the border it works perfect.
    Any suggestions will be appreciated.
    You also have to apply the border to the 'a' css selector. If you just apply it to the 'a:hover' css selector then the tab will grow slightly bigger because its adding more width and height to the overall structure.

  • Help with design of this home network setup

    Hello all
    My friend's home has internet through Comcast and their modem is an RCA DHG535-2. This modem is currently functional in their office within the home. Their problem is the wireless signal is very weak in their basement. They have purchased a TC and have placed it in their office and wired to their iMac through ethernet. Is their a better way to design this setup so the Time Capsule can provide a broader and better range throughout their home?
    For example,
    1) Can the physical location of the TC change in order to broaden and evenly provide wireless range throughout the home? I would think not since the TC needs to be wired connected to the modem.
    2) Would an Airport Express help out?
    If you can provide a step by step to set this up, I would greatly appreciate this
    Many thanks
    RezF

    Rezf, welcome to the discussion area!
    1) Can the physical location of the TC change in order to broaden and evenly provide wireless range throughout the home? I would think not since the TC needs to be wired connected to the modem.
    Since you mention that the TC is connected to the iMac with an ethernet cable, it sounds like the location options of the TC are going to be somewhat limited. Technically, you could locate the TC anywhere as long it was connected to the modem with an ethernet cable.
    If the office is located in a central area of the home, that would be a good location for the TC
    2) Would an Airport Express help out?
    Possibly. The usual location for an AirPort Express is a point that is approximately 1/2 to 2/3 the distance from the main router (the TC) to the area that needs more coverage. If you have a laptop handy, move it to the proposed location of the AirPort Express and see if you can get a good, stable internet connection at that location. If you can, the AirPort Express should provide improved wireless coverage to the basement.
    If your friends can pull an ethernet cable from the TC to the area in the basement that needs more wireless coverage and connect an AirPort Express to the ethernet cable, that will provide the strongest wireless signal to the specific area.

  • Need help with designing form for exports

    Hi
    I am pretty new to designing form in adobe acrobat.
    I have adobe acrobat 9 standard with Adobe liveCycle Designer installed.
    There are couple of things I want to do.
    1.
    I would like to add a box where I can change the number (default is 1), and when I increase it, (for instance to two)
    then
    it will postulate the particular sections twice.
    For instance, I am taking two drugs right now, then I would like to increase the number of drugs to 2, so then for each drug
    I would enter appropriate information such as drug name, drug form, route of drug administration etcs
    I hope this is clear
    2.
    I am trying to export this in xml format so that only the ones where the user fills in in pdf form gets exported to xml format.
    I would like the boxes to have its own tag, for instance the drug name mentioned above can have a tag of <drugname></drugname>
    I know this is possible through changing the box's name in binding tab.
    What I am interested in is to add a tag for the section, like a header.
    For example, if I were to enter two drug information I want the first drug information to be exported to be
    <drug>
    <drugname>blah</drugname><drugform>1</drugform><drugroute>oral</drugroute>
    </drug>
    <drug>
    <drugname>drug2</drugname><drugform>1</drugform>
    <drugroute>ophthalmic</drugroute>
    </drug>
    how would I add <drug> </drug> for each drug?
    also, can I change the order of the tags??
    in the pdf form, if the drugname box is displayed later than drugroute box, then when I export it, it will display as
    <drugroute>oral</drugroute><drugname>blah</drugname>
    but I want to manually set the order of tags when exported.
    Sorry I asked so many questions
    I hope it is clear enough for you to visualize what I am trying to do
    Thank you so much

    1. You can certainly add sections for the number of drugs that the user specifies pr
    ovided that the form is set up the correct way to begin with. The drug information section must be wrapped in a subform (usually Poistioned) and that in turn must be wrapped in a flowed subform. Then the form must be saved as dynamic. If this information is all that is on the form then that shoudl be all you need to do. If th edrug section is in the middle of the form then you need to wrap the other parts of the form in a subform so they can be pushed down when we add the drug subforms. It can get confusing ...seeing the form amnd its structure would help to clarify.
    2. You canbnot change the names of tags on the fly but you can change their values. AS mentioned above, when you wrap the Drug information in a subform that subform name can be used as a tag in the XML. Then you could have a node with the tag (or an attribute) that names the drug in question. Something like this:
    <Drug Section>
         <Drug>
              <DrugName></DrugName>
              <Dossage></Dossage>
              <Supplier></Supplier>
         </Drug Subform>
         <Drug>
              <DrugName></DrugName>
              <Dossage></Dossage>
              <Supplier></Supplier>
         </Drug>
    </Drug Section>
    As mentioned earlier this is always easier to explain when you see it in context of your form.....if you want to send it to me at [email protected] I can get you started at least. Please include a description of your issue in the email
    Paul

  • Need Help with a very simple view transition scenario

    Hello All,
    I am trying to learn how view transitions work and I am having a very hard time with the sample apps (like transition view app etc)...I need something much more simple at first. Can you please provide me a little guidelines on how to set up this following scenario:
    App loads up and shows a title screen with a button that says go. When you click on the go button the title screen fades out and a new view fades in (or slides in, or anything at all).
    Right now I have 3 nib files. There is the main one that is called on application start (tied with MainViewController, a subclass of IUViewcontroller just like in the hello world app. After the app loads the app delegate object tells the MainViewController object to load in another view controller object (via addSubview) which is tied with the second nib file; my title screen with the button. When I press the button I was thinking in the IBAction function to tell the MainViewController object to remove (or transition out somehow) the title screen view controller object then add the other view (third nib file in). This is the part I can't get working. Am I on the right track or have a gone hideously astray? Thank you!

    hi,
    i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
    i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
    1) from the appdelegate i initialize a root controller (view controller class)
    2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
    3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
    4) we also need viewA and viewB files(view class)
    5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
    5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
    it will look something like this:
    [Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
    so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
    i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps.

  • Help withe setting up a database

    Hello There,
    I come for some help, I want to be able to set up a database on my computer but I dount know how to I am on windows XP could someone guide me though what I need and what to do please.
    Many thanks
    Lol

    Pick one: Oracle, M$ (Access or SQL Server), MySQL, Sybase, Informix, IBM (DB2), PostgreSQL...
    You mean you asked this question without having a database on hand? Have you ever used a relational database before?
    Do you know SQL?
    If you answer "no" to all these questions you've got a lot to learn before you even bother with this forum, Java, or JDBC. - MOD

  • Help with java (2 simple classes)

    would anyone be able to help me with some questions about two very short java classes?
    i have come up with some answers of my own, but yeah, i'm not sure how correct my answers are....
    the 4 questions are:
    1. The data attributes m, n and grid in the HeatGrid class are declared private, and methods
    such as gridHeight(), gridWidth() and copyGrid() are provided to extract their value. Why
    is the better class design than simply declaring those attributes as public?
    My answer: So other classes accessing them cannot modify those data atributes, i am not sure why this is better class design.
    2. Why must the (global) constants in HeatSim.java be declared static ?
    My Answer: because HeatSim is what you run first and so you don't create a HeatSim object, you just access its methods, thus the need to make them static.
    3. Assuming HeatGrid has been fully implemented, during the execution of the statement
    HeatGrid = new HeatGrid(inGridFile), how many objects of HeatGrid, double [][] and
    Scanner are created?
    My Answer: 1 HeatGrid object, 1 doulbe[][] object and 1 scanner object
    Which of these objects must still exist after the statement completes execution?
    4. For each of the classes HeatSim and HeatGrid, identify the client and supplier classes
    (including library classes).
    My Answer: So far this is what i have done. for the HeatSim class, i said that the supplier classea are:
    double
    int
    boolean
    String
    Math Class
    viewgrid class
    array
    and the clients for the HeatSim class are:
    HeatGrid class
    if anyone can help me i will but up the VERY short code to these two classes. I am really stuck and any help woould be greatly appriciated! :)
    Lots o love
    Sarah

    ok here is the code (i don't have my compelted copy on me but this will do for the moment).....
    import java.lang.Integer;
    import java.lang.Double;
    import java.text.DecimalFormat;
    public class HeatSim {
        final static boolean ENABLE_VIEW = true; // if true, create GUI to view grid
        final static double DEFAULT_THR = 1.0e-02;
        final static int DEFAULT_PAUSE = 100; // pause between each update of window in ms
        final static int DISPLAY_WIDTH = 7;   // width to print each grid value
        final static int MAX_MN_DISPLAY = 10; // maximum grid size to be displayed
        public static void main(String[] args) {
            // initialize program `parameters' according to the command line,
            // entering `default' values if none were given
            String inGridFile = (args.length < 1)? "": args[0];
            int nIter = (args.length < 2)? 1: Integer.parseInt(args[1]);
            double Thr = (args.length < 3)? DEFAULT_THR: Double.parseDouble(args[2]);
            String dumpFile = (args.length < 4)? "": args[3];
         DecimalFormat residFormat = new DecimalFormat("0.00E0");
            ViewGrid view = null;
            System.out.println("HeatFlow simulation program");
            if (inGridFile.equals("")) {
                System.out.println("Error: an empty grid file name was entered");
                return;
            // create HeatGrid object
            HeatGrid heatGrid = new HeatGrid(inGridFile);
            int m = heatGrid.gridHeight();
            int n = heatGrid.gridWidth();
            if (m <= MAX_MN_DISPLAY  && n <= MAX_MN_DISPLAY) {
                System.out.println("\nGrid at time 0:" );
                heatGrid.display(DISPLAY_WIDTH);
            if (ENABLE_VIEW) {
                // create a ViewGrid WINDOW object to view the grid
                view = new ViewGrid(m+2, n+2, DEFAULT_PAUSE);
                view.display(heatGrid.time(), 0.0, heatGrid.copyGrid());
            while (heatGrid.time() != nIter && heatGrid.residual() > Thr) {
                heatGrid.iterate();
                if (m <= MAX_MN_DISPLAY  && n <= MAX_MN_DISPLAY) {
                    System.out.println("Grid at time " + heatGrid.time() +
                                    " has residual " +
                         residFormat.format(heatGrid.residual()));
                    heatGrid.display(DISPLAY_WIDTH);
                if (ENABLE_VIEW) {
                     view.display(heatGrid.time(), heatGrid.residual(),
                                  heatGrid.copyGrid());
            } //while(...)
            if (ENABLE_VIEW) {
                view.finalize();
            if (!dumpFile.equals("")) {
             heatGrid.dumpGrid(dumpFile);
            System.out.println("\nHeat Flow simulation of (" + m + "+2)x(" + n +
                               "+2) grid ends at time " +  heatGrid.time() +
                               " with residual " +
                      residFormat.format(heatGrid.residual()));
        } //mainProgram()
    } //HeatSim
    import java.util.Scanner;
    import java.io.*;
    import java.text.DecimalFormat;
    public class HeatGrid {
        private int m, n;
        private double[][] grid;     // m+2 x n+2 array representing a grid
        private int t;               // the time the grid has been evolved
        private double resid;        // residual left from the last timestep
        // initializes m, n and grid according to the information in the grid file
        // of name gridFileN; sets t to 0, and resid to Double.MAX_VALUE
        public HeatGrid(String gridFileN) {
        } //HeatGrid()
        // returns the value of m
        public int gridHeight() {
            return 0;         // [ replace with an appropriate value ]
        } //gridHeight()
        // returns the value of n
        public int gridWidth() {
            return 0;         // [ replace with an appropriate value ] =
        } //gridWidth()
        // returns the value of t
        public int time() {
            return 0;         // [ replace with an appropriate value ]
        } //time()
        // returns the value of the residual from the previous timestep
        public double residual() {
            return 0;         // [ replace with an appropriate value ]
        } //residual()
        // returns a copy of the grid
        public double[][] copyGrid() {
            return null;         // [ replace with an appropriate value ]
        } //copyGrid
        // precondition: all elements of grid can be printed to 1 decimal place
        // using width characters.
        // prints the m+2 x n+2 grid by rows, rows in descending order.
        // All values are printed to 1 decimal place, and are right-justified
        // in a text field of width characters.
        // Note: this method is for debugging; hence right-justification is useful
        public void display(int width) {
        } //display()
        // advance the simulation a single timestep
        public void iterate() {
         } //iterate()
        // prints the m+2 x n+2 grid by rows, rows in ascending order.
        // All values are printed to 2 decimal places, with at least one space
        // between them.
        // Note: this method is intended for result checking by a computer program;
        // thus justification is not important.
        public void dumpGrid(String outGridFileN) {
        } //dumpGrid

  • [New] Help with a VERY simple asterisk program.

    Alright...I feel like a complete idiot asking this question..but I'm having such trouble writing this program. The program description is here:
    Write a Java application using two for loops to produce the following pattern of asterisks.
    I guess I'm really bad at algorithms yeah? Haha...well, any help would be very much appreciated.

    Hi,
    I don't think you don't need to look through any C programming books.
    When you have a problem like this, do some thinking about what methods you need to use and what the general structure of the program will be.
    You need to print asterisks out to the screen... so you'll need:
    System.out.println
    System.out.printAnd you already know that you need two loops.
    Now you can ask yourself how you might use the print statements with two loops in order to design a basic structure for the program.
    You have 8 lines, so you might want a loop that runs through 8 times, one of the lines printed each time.
    Within this loop, you need another loop that prints out *'s. This loop could run once for each asterisk, but because there is a different number of asterisks on each line, the number of times this loop runs would be variable.
    So a basic structure:
    //loop1 that runs 8 times
        //loop2 that runs once for each *
            print one star
        //end loop2
    //end loop1The key now is to recognise the difference between print and println. I don't know if you alread know, but System.out.print will print a string without creating a new line at the end, and println will create a new line at the end of the printed string.
    Hope that helps. If you have any other problems, post specific questions along with the code you've written and are having trouble with.

  • Need help with something VERY SIMPLE

    I'm brand new to Motion - as if today - but I'm only trying to do some VERY simple motions with photos - a simultaneous zoom in and reposition. What I've been doing is setting the starting key frame at one position (adjusting the x, y) and setting the scale. Then I create a second key frame and adjust the postion and scale. It will do the zoom, but then it re adjusts the starting position. If I readjust the starting key frame, it automatically readjusts the second key frame. I don't get it! Applying the various 'behaviors' doesn't seen to help. Certainly there's something obvious here that I'm missing - as I was able to do this in FCP. For some reason the key frames are not fixed when it comes to position.

    hi,
    a couple of thoughts?
    did you actually set a keyframe for position at the first frame?
    Also unless you are parked right on a keyframe or have the record button on, if you adjust a value, all the values for all keyframes adjust accordingly. I often mess something up because I wasnt parked on a keyframe.
    hth
    adam

  • Help with design required.....

    hi,
    i have a server which uses the following mechanism to log messages into a log file.
    public static void Message(String msg)
         print(msg);
    public void print( String msg )
         intprint(msg);
    private synchronized void intprint(String msg)
         i write into a log file using RandomAccessFile.
    the Message method is called by 100 of classes to write into the log file.since the intprint(--) is synchronized and with so many other classes trying to use it, it slows down my server.
    i was trying to have a design to make it faster.can somebody help me with that...any suggestions??
    Thanks,

    Use threads and queues for the purpose. How about using arraylist for queuing purposes. The no of messages in the queue can be as many as you want.

  • For Expert (Help with designing my company VOIP infrstructure)

    Imy company have two offices with 200 users in each and we want to design VOIP solution has the next feature.
    Call forwarding
    Voicemail
    Integrated messaging
    Integration with CRM Tools
    Data Integration
    Automated call distribution
    Auto attendant
    Directory services
    Unified communication collaboration
    Web based administration tool
    Analytical tools
    Presence management
    I would like to know which devices, programs , and IOSs should I use?

    First of all
    Leo pointed you to the document i recently posted in CSC which can help you in the design phase if you are going to consider video in your network with voice
    to answer your questions based on the number of users you mentioned CUCM (business edition can be a good option )
    Call forwarding feature in CUCM
    Voicemail you can have unity connection with CUCM
    Integrated messaging unity connection can integrate with exchange and outloook
    Integration with CRM Tools what integration you need .. is it for contact center if yes then cisco UCCS contact center express can do it
    Data Integration same as above
    Automated call distribution you can use either UCCX or unity connection or basic call handling using CUCM
    Auto attendant UCCS or Unity connection
    Directory services CUCM can integrate with LDAP/AD or use a local directory
    Unified communication collaboration what type if collaboration, video,sharing ..!
    Web based administration tool most of the above is web based
    Analytical tools embedded with the above systems
    Presence management CUCM 9.x can have it iwth CUCM
    it is recommend to use virtualized UC services on UCS for cost saving as well and simplified design ( UC on UCS )
    Hope this help

  • Help with designing a small project

    I'm still relatively new to game design. I want to attempt to make a clone of the TI Calc game "Fall Down" (http://www.ticalc.org/archives/files/fileinfo/140/14064.html). It's an incredibly simple game overall, but I can't seem to figure out how to handle everything in an object oriented manner
    So far in my design process, I have a Blackboard class (that extends JPanel) that's responsible for painting the game screen. The ball is represented by a Ball class that contains the location of the ball on the screen, as well as 3 functions to move the ball. I have a floor class that will represent one rising floor with a hole in it.
    I've delegated moving the floors and ball upward toward the top of the screen to a Conveyer class.
    I'm still left with one slight problem: to which class do I give the responsibilty of receiving keyboard input to update the position of the ball? I can't give it to the Ball object itself, because it's not aware of it's surroundings (and thus the Ball class can't know if it's okay to move left or right). Using the conveyer class would work, except it's already been delegated a large task of updating all objects. The Blackboard is already busy with painting to the screen.
    What would be the most appropriate way to go about this?

    I would assign the ball controlls to the main game class (game window or game applet) and send the new position to the ball itself. The main advantages are:
    => If you take the main class to be an Applet or some subclass of a Component (Frame, Window, Panel, JPanel... although I wouldn'd drag JavaX into it. The game should be perfectly doable with just standard AWT components) You can directly implement a KeyboardListener class that handles the keyboard imput and translates them to the ball position.
    => If you take a classic arcade approach allowing the ball ONE movement (left-right) per movement of the floors, you can use the same thread for the floor and ball. Locate the thread in the master clas and have it call the ball as well as the transporter.
    The distribution of functions between the differnt classes would now be:
    main FallDown class:
    - an applet or Frame that implements the KeyListener classes
    - On KeyListener.KeyEvent: set the desired movement of the ball to the new direction.
    - implements main game thread: the thread continuously calls for a certain 'sleep' time and between each time takes a 'game turn' :
    # calls the ball to move. The ball will move in the direction set beforehand by the key listeners
    # calls the floor conveyor to move all the floors one level up
    # checks if the ball crashed into the floor by comparing the current position of the ball with the current opening in the highest floor
    # calls a 'repaint()' to redraw the game screen
    - on Paint(Graphics g) or update(Graphics g)
    # clears the screen in background color
    # draws the ball by calling its own paint(Graphics g) function (passing the current graphics)
    # draws the floors by calling the floor conveyor's paint(Graphics g) function (passing the current graphics)
    Ball class
    - contains a paint(g) function to paint the ball on the screen
    - contains a setDirection function to set the desired direction upon a request of the main classes' keyboard listener
    - contains an updatePosition() function to set the ball to its new position every time the main turn loop passes a new turn
    - contains a getPosition() function that returns the position to the main class to check for colisions with the wall
    FloorConveyor class:
    - contains a paint(g) function to paint all the floors on the screen
    - contains a moveUp() function to move the floors one position up every time the main turn loop passes a new turn (also initialize new floors on the bottom of the conveyor?)
    - contains a getOpening() function to allow the main loop to compare the opening of the uppermost floor with the position of the ball
    (Floor class:
    - contains a paint(g) function to draw a floor
    - contains a moveUp() function to move the floor one position up when requested by the conveyor
    - contains a getOpening() function to pass this floor's opening to the floorconveyor
    'Niklas

Maybe you are looking for