I've been working in Java lately, and I have OOP down. More recently I've been working on web based programming with jQuery, javascript, PHP, and most recently MySQL. With OOP its very easy to manage objects and read/write information about them. Now that I'm learning MySQL, I'm finding it hard to convert a simple OOP program to an online "program" that stores its data in a database. I've been playing around in Access, just so I can get a visual of the whole database, and can't seem to come to a good way of storing the data. For the purpose of learning this... here is a simple OOP class structure (Java) that I would like converted to a database (so to speak).
public class Tournament {
////////////////////////////////////////////
//Variable Declaration
////////////////////////////////////////////
Team[] theTeams; //Array of Team Objects
int numTeams; //Number of Teams
////////////////////////////////////////////
//Functions and stuff
////////////////////////////////////////////
}
public class Team {
////////////////////////////////////////////
//Variable Declaration
////////////////////////////////////////////
Player p1; //Player 1
Player p2; //Player 2
int teamNum;
////////////////////////////////////////////
//Functions and stuff
////////////////////////////////////////////
}
public class Player {
////////////////////////////////////////////
//Variable Declaration
////////////////////////////////////////////
String fName; //First Name
String lName; //Last Name
////////////////////////////////////////////
//Functions and Stuff
////////////////////////////////////////////
}
For a database, would I want it something like this?
Maybe I'm completely offbase with the whole idea. I'm not sure. If someone could let me know where I'm at, that would be great. All help's appreciated.