Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: Java, A good choice?

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Java, A good choice?

    Hello All,

    I’m very much a newbie with Java, so please excuse my ignorance as I start the path to enlightenment…

    My son has asked my help to create a logic game he’s been thinking about for some time. It’s not graphics driven so I thought it might be a good long term project for the both of us to learn Java.

    My plan is to initially develop the very basic aspects of the application structure and slowly refine the project to meet his needs (as our understanding of Java programming improves).

    Here are a couple of questions:
    • A chat server application that resides on a Linux web server accessing a local MySQL database interfacing with Java applet clients across the WEB – Is Java a good choice for this type of application?
    • If Java makes sense, what type of configuration would be required for Java on the server side (Linux)?


    Thanks,

    -Bill


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java, A good choice?

    This project doesn't sound like an easy one...in other words it sounds quite fun.
    A chat server application that resides on a Linux web server accessing a local MySQL database interfacing with Java applet clients across the WEB – Is Java a good choice for this type of application?
    Given you wish to have an applet, java is a requirement for the client side. Server side you could go with quite a number of languages (php, asp, perl as the scripts and html/xml as the communication language), but if you want to remain consistent across server and client then java would be the choice (given the applet requirement).
    If Java makes sense, what type of configuration would be required for Java on the server side (Linux)?
    You need an application server. JBoss or Tomcat would be the first choice. And you will need to learn the basics of one or both of JDBC and enterprise java beans. If you go the JDBC route, you need to become familiar with SQL.

  3. The Following User Says Thank You to copeg For This Useful Post:

    BillnTexas (November 11th, 2010)

  4. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Java, A good choice?

    Is it possible for the both the Java applet and server side to utilize stored procedures within the MySQL server? Does it make sense to keep most of the database logic/functionality withing the database server or are there advantages to having those methods/functions local to the Java applications?

  5. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java, A good choice?

    Quote Originally Posted by BillnTexas View Post
    Is it possible for the both the Java applet and server side to utilize stored procedures within the MySQL server? Does it make sense to keep most of the database logic/functionality withing the database server or are there advantages to having those methods/functions local to the Java applications?
    The basic design of applications such as this is to keep application logic on the server side, or at least separate from the client. This prevents any logic from being locked into the client directly (placing the logic on the server side makes it easier to change clients or use multiple clients). Technically you could keep all the logic centralized in the applet itself, accessing the database directly, but this makes changes in the long run difficult. This design is technically termed the MVC design, for Model-View-Controller.

  6. The Following User Says Thank You to copeg For This Useful Post:

    BillnTexas (November 11th, 2010)

  7. #5
    Junior Member
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Java, A good choice?

    I agree that encapsulating the logic in the server side make the most sense. Is is fairly straight forward to access stored procedures withing the SQL server or would it be best to keep your SQL logic function library (I'm sure it's calls something specific in Java) within the Java server application? Thanks, -Bill

  8. #6
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java, A good choice?

    Quote Originally Posted by BillnTexas View Post
    I agree that encapsulating the logic in the server side make the most sense. Is is fairly straight forward to access stored procedures withing the SQL server or would it be best to keep your SQL logic function library (I'm sure it's calls something specific in Java) within the Java server application? Thanks, -Bill
    You can access stored procedures using JDBC fairly easily. I would classify stored procedures and application logic as different, so I wouldn't necessarily recommend keeping all 'procedures' java side. In fact, keeping it java side could severely increase the network usage if your application server and database server are on different machines. A stored procedure is a single call and return, whereas doing so in the application server could result in several calls, some could return even more information than you wish which is a waste of bandwidth. Of course these are just general (and flexible) rules, each situation is different.

  9. The Following User Says Thank You to copeg For This Useful Post:

    BillnTexas (November 11th, 2010)

  10. #7
    Junior Member
    Join Date
    Nov 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Java, A good choice?

    I appreciate the help. I have a small Linux server for testing at the house and I'm sure I'll have many questions regarding configuration (is there a cheat sheet for Tomcat set up?). Also, what Java IDE do you recommend (I run Windows 7). Thanks, -Bill

  11. #8
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Java, A good choice?

    I use Eclipse as my Java IDE. I run Windows 7 64bit

Similar Threads

  1. Want to write good programs
    By dak2007 in forum Member Introductions
    Replies: 2
    Last Post: April 22nd, 2010, 04:21 PM
  2. Good Morning/Day/Afternoon/Evening/Night
    By K0209 in forum Member Introductions
    Replies: 3
    Last Post: January 4th, 2010, 11:26 AM
  3. Good Beginner AWT tutorial
    By helloworld922 in forum AWT / Java Swing
    Replies: 2
    Last Post: August 4th, 2009, 10:31 AM
  4. Which interface gives more control on serialization of an object?
    By abhishekraok2003 in forum Java Theory & Questions
    Replies: 1
    Last Post: May 16th, 2009, 10:17 AM
  5. Replies: 2
    Last Post: May 16th, 2009, 05:23 AM