Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Project Help - Possible Wall of Text  RSS feed

 
Brian Drelling
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To anyone who got past the subject threatening with a wall of text, thanks! I have a tendency to ramble on and produce walls of text. I was born with the gift of words--just not the gift of brevity!

You can just skip the next few paragraphs and move to the actual questions if you'd like.

To start, I am 19 years old and currently in my Sophomore year at Penn State for an eventual major in Computer Science. I currently have a C++ class as my first real college course in programming, however, I have experience incorporating all sorts of programming languages into my web development, enough to the point where I could edit and work with code and understand it... just not write it or create anything.

The college has these "ACURA" projects--not really sure what it stands for, but it is essentially used for research. In essence, a student receives 1 credit for the first semester they take on a project, and 2 credits for the second semester. There was an offer to design a program as one such project, which I snatched up because it interested me and I was feeling impulsive that day.

The project was first presented as a trivia program for use with the Physics class I had in tandem with the C++ one, so my initial thoughts of the project were that it would be ridiculously tough and hard to implement in a single semester using C++. After being turned toward Java again (and remembering how beautiful it was to use and work with), I set my goal on using Java. I will be studying Java using the book that turned me onto this place-- Head First Java, Second Edition.

In summary, the "goals" I have set for myself for the project must be as follows:

By the end of the first semester (roughly 2 months), the project must:

Have a "client" program (used by students) that can take inputs and output them onto a "server" program (used by the professor) and display how he likes. The program must be user-friendly, with buttons and a proper (but light) GUI. It must be built with the final result (see below) in mind, because reverse-engineering the existing program would be a hassle. The programs MUST be run on a Local Area Network, as access to the internet (due to the trivia) will be turned off, allowing only a LAN connection. The program will only take the output from the students and display it on the teacher's screen, which he will then work with and copy/paste to do what he needs to do.

By the end of the second semester (close to 6 months), the project must:

Allow the teacher to store trivia questions prior to a class, reference these "sets" of questions in the future, edit them using the program, attach pictures to the questions (if applicable) to display, keep track of the score of users, display round numbers and scoreboards between the rounds, and include a GUI for the teacher to pass through the outputs to be displayed on the main screen that students will see, as well as allow the students to have a GUI in which they can (possibly) receive the output that is displayed from the teacher on their own computer, which will be handy. (This could take two programs in the end.) I estimate it will require the use of a local server (TOMCAT?) and a database (MySql?)


So here are my questions:

1) Can anyone give an estimate of how complicated my task will be? I have two months for the first (primitive) result, and roughly six months for the fancy one. I have an understanding of code, a desire to learn, and a will to work my butt off. I have a good reference book in hand, and what looks like a great site (seeing other questions besides my own is awesome!)

2) What sounds like it could potentially be unnecessary or complicated, and what is easier than it sounds?

3) When it comes down to using a LAN connection, how tough is it to incorporate? (I/O, database, advanced GUI functions, multi-threading, etc.)

4) Any other books I should pick up? (I have a $500 fund. Only used $100 so far. I do not get the money I don't spend, and unnecessary spending looks bad.)


Thanks in advance! I hope I am putting all this in the right place and that my wall of text isn't too bad on everyone. I felt I had to provide sufficient backgrounds for my questions.
 
Campbell Ritchie
Marshal
Posts: 55715
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Tell us which books you have, and we can see whether we think you need anything else.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Drelling wrote:So here are my questions:

1) Can anyone give an estimate of how complicated my task will be? I have two months for the first (primitive) result, and roughly six months for the fancy one. I have an understanding of code, a desire to learn, and a will to work my butt off. I have a good reference book in hand, and what looks like a great site (seeing other questions besides my own is awesome!)

2) What sounds like it could potentially be unnecessary or complicated, and what is easier than it sounds?


The server / client communications will probably be easier that you think it is, as long as you have a sound protocol. It is probably good to consider a communication protocol up front to at least get you pointed in the correct direction. The more concise the protocol is the easier the communication will be - and the easier it should be to add functionality to when you need to.

Using Tomcat / Servlets is probably over kill, and perhaps not appropriate. What your Server application actually is is a GUI application which accepts clients for talking. It sounds like the Server needs user interaction and probably pushes data to the Client, rather than having the Client request information from the Server. Because of this, the stateless request/response protocol servlets are designed for probably aren't the right tool - they will only complicate things.

Just use Sockets for communication.


3) When it comes down to using a LAN connection, how tough is it to incorporate? (I/O, database, advanced GUI functions, multi-threading, etc.)


Using a network for communication doesn't have to change a whole lot - see above about Sockets and a good protocol. Once the protocol is in place, reading and writing to a network is as easy as reading / writing to a file. The Java database system (JDBC) is designed with network-connected data sources so there is nothing special there.

The GUI should be kept as far separated from the network as possible, you shouldn't have any network communication code in the same class you have GUI code. So there should be zero impact on the GUI if you are working on a network or not.

Multi-threading on the Client probably revolves more around the threading conditions related to Swing (the GUI) and keeping the work of the app done in a different Thread than the GUI is drawn in (so the GUI remains responsive). This is standard stuff and your book should cover it, if not then the tutorials on the Sun website do. On the server you will need to take into consideration the same threading issues for GUI/non-GUI code, but also each client will typically have its own thread for communication to you have to be a bit more careful about what data is shared between threads.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p.s. Libraries are a great place to get more books on the cheap :-)
 
Brian Drelling
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies! This happens to be the fastest I've ever received a support response on a website based around volunteer support in... well, forever.

The books I have, besides 'Head First Java, Second Edition', were some others to be safe and reference. I also found the FAQ on books to buy which I skipped over prior to posting--I have some good ideas from that thread.

One of the other books to mention was 'Head First Java Servlets & JSP', I think it is called. Seemed handy.

Not having to use a server or TOMCAT seems like a big plus! That makes me very happy that I won't have to deal with those things. However, the idea of messaging protocol and the like is VERY new to me. Is there a better place to find information on this that can kind of... start me out? How things actually work behind the scenes? I see the Sun tutorials, and have been using them--they rock--but for someone with really no clue about what it is doing in the background and what you're making happen/where info is stored it is a little confusing. Perhaps I should know this stuff already...

And yes, ideally, the "server", or "professor", program will receive the input to start, so nothing too complicated. However, in the advanced bit, he will be able to store and keep track of questions for games and previous games, in a way that will allow him to update them on the fly and keep track of with no fear of them erasing, and with the ease of access so he can actually manage them without having to know commands or deal with files outside of the client. All it needs is text and image, nothing more advanced than that.


I am happy to learn more and more about Java's native classes (is that the wrong term?) that allow it to do things like build a GUI and access networks/databases with ease.


When you discuss having the threads run separately and... all the other stuff you said about the GUI/program that I'm not sure I understood, is there a better method of understanding this? Here is what I took from what you said:

All the processes are running independently.
The GUI will display the processes that are running separately, such as the score, the current question, the input field, etc.

Is this all there is too it, or am I misunderstanding? Also, sorry if I give things the wrong name--I'm still not sure what the "reserved" vocabulary terms are for things like this.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, we are jumping a head of things a bit. The best places to learn these things are through books and tutorials. You have a real good book there in "Head First Java." Take your time and go through the book and you should understand a lot more.

The rest of my post was more about pointing out there shouldn't be a lot of specific information that you need, outside of the book. Rather, when the book starts talking about File I/O you should start thinking about 'talking across the network' (with the keyword Sockets to help you out). When the book starts talking about Swing, think GUI. When it starts talking about JDBC, think Database.

As for the 'network protocol,' it doesn't have to be fancy - it just has to be clear. Wait until you have a basic design concept - what you want the application to do, when is it supposed to do it, and how does the application know to do what. When you have that, separate out the parts that need to talk with the network and try to think of how you would communicate the same information to a computer over the phone (ie short and simple, but clear as possible). By the time you know what you need to say and when you need to say it you will probably have a better idea of how to send it.
 
Brian Drelling
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your bit about the keywords will be extremely helpful. I'll make sure to remember them! Thanks for the great instruction, and support of the book... glad I made the right choice!

So attempting to do this from scratch with that book and the idea of the end result basically being a whole, working program with multiple functions... that isn't as intimidating as it seems to me?

Right now, I feel like I have gotten myself into an unbreakable pact that is going to make me look awful, but that it will simply be impossible for anyone to complete in this short time. I have no doubt I'll pick up Java fast enough to have the understanding when I need it (in terms of time constraints), but I worry that I won't be able to complete it in time!
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, don't be intimidated by it, you should be able to cover what you need for the first semester in the first 2 months with the help of the book, the Java Tutorials, and the JavaDocs (a.k.a 'The API'). Don't stress out and keep yourself progressing through the first few chapters of the book making sure you do all the exercises. Once you are comfortable with it you might try jumping a bit to cover specific chapters you feel will help with the program - but make sure you read the in-between chapters eventually as well, and don't jump too far - chapters at the back of books are usually there for a reason :-)
 
Brian Drelling
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much, again!

I appreciate you taking the time to read my anecdote and my questions and give me some great responses. I'm keeping this thread bookmarked to reference as I learn, and I will come back to the boards if I have any questions. It's good to know my project is able to be completed within the time span I have been allotted.

Again, thanks a lot.
 
Brian Drelling
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to "bump" my own thread, though it isn't really a bump and I didn't see the use in making a whole new thread for a related topic.

So aside from having each round play out as above, I just got done playing a round of his normal game the way he does it. Between his rounds, since he has no program built and no networked way of sending the answers (which I will be doing all this as part of my project), he has "quick answer" rounds, in which he might give a hint and an anagram, such as:

Hint: A division of physics

AQUA SUMMIT CHICKEN

Answer: Quantum Mechanics


With that said, how hard would it be to create an anagram maker that operates in the sense that it will try to come up with words to combine, separate them appropriately, capitalize the words (not hard), and allow for students to input the right answer until they get it right?

I'm not sure if I could find the Anagram API anywhere, but this site is a favorite of mine: http://www.sternestmeanings.com/

Essentially, I could have him put the words into a .txt file on each line, and have the game randomly pull from a line. After it does so, it'll never go back to that same line again throughout the game. The display will shuffle the letters in a way that still resembles words but doesn't necessarily have to, capitalize the words, and space them out (all to throw students off)

Students can then type in their console.

Perhaps every minute or so of no answer, it'll automatically reshuffle the characters?

Another advanced tool would be that when a letter is put into the text box, it would cross out the letter above. This is just a thought if it is easy, but not necessary at all.


So:

1. How hard would this be to implement?
2. Is it possible/easy to implement?
3. How would I go about doing this?

Obviously an Anagram API would be as necessary as a dictionary type of thing for spell check. Perhaps Java has a native way of doing this (it surprises me some times... a lot of the time, actually!)


Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!