Results 1 to 2 of 2
Thread: Where do I begin
- 12-24-2009, 12:58 AM #1Member
- Join Date
- Dec 2009
- Rep Power
Where do I begin
First.. sorry for my bad english!
I have no idea where to start!
I need to make a program with people connection links.
I have to program a "10 people connection links", like a chart.
Person 1 - Peter
Person 2 - Adam
Then when the user input a name; let's say Peter, the computer output:
(Because they go to school together. The 7 other name's will not be output because they go to an other school).
So; "If they go to same school, make link!".
Do i have to make a class for the persons, one for the "program" and one which save the names somewhere?
I tried to paint so maybe you can understand:
- 12-24-2009, 06:32 AM #2
In a database, we might have 2 objects,
a school object
a person A(student) object.
and there might be a 3rd table that joins the two together
[person] <-- [person_school] --> [school] id person_id id name school_id name
but since the person can only be in one school, we can remove the middle table here
[person] --> [school] id id name name school_id
Sorry for the database-y things, I'm a DBA so thats how I think.
but in Java land, the objects might look like (in memory, assuming we just want to set up some kind of mapping to store these for this assignment and don't really want to use a database).
Map<String, School> schools; // the schools, indexed by name List<Person> students; // the object representing a person, name, and school name properties
Map<String, List<Person> > peopleBySchool; // a map, key = school name, entry = people in this school.
- By shintashi in forum New To JavaReplies: 3Last Post: 07-23-2009, 09:33 AM
- By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 09-27-2008, 02:20 AM
- By Triji in forum New To JavaReplies: 1Last Post: 08-11-2008, 03:25 PM
- By dimitrist in forum New To JavaReplies: 11Last Post: 05-13-2008, 04:49 AM