Database Discussions
One of the major planned components for tXtFL 2.0 is a database to manage all teams, players, seasons, and leagues. Providing a central database will allow for much easier and more powerful game management at all levels. And it will make programming much easier, as adding new statistics or parameters becomes a database manipulation rather than the current arrangement of text files and complex arrays.
Here are notes on database developments so far. Feel free to chime in! As we are in early development stages, now would be a great time to get involved.
Database Choice
We've decided to incorporate the Abache Derby database. As the official database of Java, Derby can be integrated more seamlessly and run on all the major platforms that Java supports. Derby supports common SQL queries and should make life easier for developers with a background in relational databases. Its small footprint and embedded capabilities should make life more fun for the end-user as well.
Relational Diagram
An early draft of the relational diagram is here. Feedback welcome before we delve into the tables!
UPDATE (2009-12-29): The schema is undergoing many modifications, as expected. The schema now gets loaded programmatically, and it currently handles player inputs from tXtFL Draft.
Database Details
As of alpha3, the database will be stored in a consistent place within the user's home directory. On Windows, this directory will usually be C:\Users\[username]\.txtfl.
Default players and teams will now be embedded within the application JAR to permit loading as a resource when launched through Java Web Start. Spreadsheets with "players" or "teams" in their names can be loaded into the database through Draft. Draft will look for the files in the home directory, although future updates might use a standard location.
Alpha4 will incorporate work on database version detection and migration to new versions as each new pre-release often includes schema changes.
Milestones
| Milestone | Features | Completion date | Release version |
| M0 | Database selection, schema formation | 2009-10-30 | alpha1 |
| M1 | Database connection, table formation | 2009-12-29 | alpha1 |
| M2 | Complete player and team insertion | 2010-01-01 | alpha1 |
| M3 | Game records and basic stats | 2010-01-13 | alpha2 |
| M4 | Player/team/play import by spreadsheet | 2010-01-30 | alpha2 |
| M6 | Seasons | 2010-04-30 | alpha3 |
| M7 | Leagues and rule sets, database version checking/migration | in progress | alpha4 |
| M8 | Graphical database management | alpha5 | |
| M9 | Database optimizations | beta |