I'm fairly new to programming and have been focussing a great deal on Java in recent months. I would like to write an application with a Java applet front end which will capture information about my users and allow for them to be organised for sporting events. This seems to lend itself very nicely to the object orientated approach (e.g. each user is an object, each event is an object, each coach is an object, etc.).
However, my users will all need to access and make changes to the data stored as objects. A database of some sort seems to be called for but I only really have experience with RDBMS and I can't see how that maps to an object based front end. I could just use PHP driven HTTP calls but that would mean translating objects into tables and that feels like a move away from a pure OO approach - and I'm really trying hard not to slip into a procedural way of thinking, which is more my background.
I'm vaguely aware of JSON and NOSQL databases but not enough to know whether they are the solution to my problem. So, given all of this, I would really appreciate any views on the best way to keep things OO whilst at the same time having a client/server model allowing shared access to the application's data. I'm sure there's an easy solution - I'm just struggling to find it!
Any tips/thoughts?
First of all, you seem to be thinking that OO and RDBMS' can't be a good match. They can be a good match IF you setup your schemas correctly. There's far to little info to go on here, but often a single java-class to a single db-table can be a good start. That's the java to RDBMS part.
Communicating from your application-server to the client has nothing to do with this part (I'm saying because you seem to be suggesting it has?)
Having said that, NOSQL can be a good approach for having less restrictive schema's and (you're right here) often map more intuitively to objects as you would envision them in a oo-world. As for suggestions, I'm using MongoDB and it's great .. Also at this point JSON comes around the corner as the data-format to communicate with MongoDB.
All these technologies can be rather overwhelming if you're starting out, so instead of me advising you to pick A or B, perhaps it's better to checkout some good java web-frameworks that abstract away from persistence implementations so you can swap them out later without much problems? (Say Mysql for MongoDB, etc. )
I can highly recommend the Play Framework (http://www.playframework.org/) which gets you going pretty quickly and intuitively. Follow along the examples (they bolg a blog step by step including persistence, etc. ) and you get introduced nicely to the concepts.
Perhaps later you can check out plugins to use MongoDb instead of 1 of the default RDBMS's that come with Pplay, to see what you prefer.
Hth, Geert-Jan
First be clear on your requirements and then try to determine what technologies suits your needs. You can look of capability into each datastore (MySQL, PostgreSQL etc) and see which one fits your requirements. Next look into JDBC to query/manipulate the data in the database.