Property File Support

Discussion in 'Bukkit Discussion' started by Nodren, Jan 5, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Nodren

    So I wanted to address property file support. Based on what I know of hmod, there was always quesitons about "can you support SQL" if they dont support it, or "can you support flat file" if they only support SQL(MySQL, SQLite, etc).

    so that said, I have my own opinions on it, and figured it would be nice to share them.

    What if there was support for both flat file and database? Obviously the file format for properties is fine as is(what notch uses and what hmod supported). SQL part, thankfully that can be solved using EAV.

    I was also thinking accessing properties could be done better. instead of:
    Code:
    PropertiesFile p = new PropertiesFile("server.properties");
    p.getInt("some-property");
    we could do something like:
    Code:
    Properties p = new Properties();
    p.getInt("server.some-property");
    
    I guess then the final part, is for plugins that require a more complex data storage option, can extend on the property classes to create their own tables for SQL, or their own file formats for flat file. This would allow server mods to enter a choice once, and it would "just work" and for the 90% of plugin devs out there, we could support flatfile and SQL with zero extra effort. Those who need something extra have the option, with out requiring extra work on the part of the server moderator to configure the plugin before use.

    I know my opinion doesnt mean much but just thought i'd start the discussion for everyone.
     
  2. Offline

    Raphfrk

    I think having a API for properties is a good idea. The admin would could then set it up so that it can target any storage system.

    I think that keeping it like a file system is still reasonable.

    Code:
    PropertiesFile p = new PropertiesFile("directory" + slash + "filename" );
    p.getInt("some-property");
    
    This would do something like

    Flat File Mode

    Operate on the file in

    directory/filename

    SQL mode

    Create a table called directory_filename

    Each property is then a column

    The plugin author doesn't care where the data is actually stored as long as the properties come back correct.
     
Thread Status:
Not open for further replies.

Share This Page