old Post:
@sk89q announced that they need help with some packages .
Today I want to talk about the “util.config ” one.
#I want not talk about the format
I want to talk about the API and usage.
sk89q want a typesafe config system.
I prefer a annotation system, e.g. DragonAntiPvPLeaver/src/com/github/idragonfire/DragonAntiPvPLeaver/DAPL_Config.java at master · IDragonfire/DragonAntiPvPLeaver · GitHub
@Faithcaio created a similiar lib for that:
GitHub - CubeEngine/ReflecT: Typesafe serialization of data for Java
What did you think?
Persistence layer
In constrast to config stuff, also data must be stored …
What is with a default abstraction layer?
If we have a annotation based system we can introduce a general persistence layer and the config
system is build on top of it.
I’d like to see a ‘universal database’ type API. Something were I can set up the connection parms to my database (mySQL, SQL Lite, or whatnot) and then this be used by all other Sponge plugins. This way if I move my db or set up a new one I don’t have to remember which plugins have their own db config section.
PR: Add config api by killjoy1221 · Pull Request #90 · SpongePowered/SpongeAPI · GitHub
Issue: http://issues.spongepowered.org/youtrack/issue/SPONGE-6
IDragonfire:
PlayFramework?
Play is a web application framework and not a persistence API. Play uses Ebeans by default.
+1 from me as I’m also a part of its development
Thanks, only worked with Bukkit Ebean and that was great
(After I learned it^^)
I misunderstand the gdoc table …
sk planned to use:
It is already shaded into Forge.
Has this been implemented yet?
sk89q
September 26, 2014, 10:47am
7
I (or someone) needs to play with Typesafe Config to see if it can emulate convention with Bukkit plugins (file header, write back defaults, etc.).
I think with whatever Config that is implemented, we should make sure to support comments, that was a major flaw in Bukkit’s Yaml configs.
2 Likes
n1b
September 26, 2014, 2:15pm
9
Yaml supports comments. Use # Here is my comment
.
Yaml supports comments, yes, but with Bukkit, if you were to save the config or something of the sort, the comments, except for the ones in the header would be removed or pushed to the header.
1 Like
n1b
September 26, 2014, 2:32pm
11
Ohh, that is annoying. Never tried it xD
Comments were possible,
you need only some extra stuff for it
My stand: Sponge Config System uses HOCON instead of YAML.
I think they are planning to use HCOON
IDragonfire:
HCON
Google fails when I google that . And i don’t think this is where I am looking for xD: http://www.hcon.in/ . Sorry I am pretty sure it is something but can’t find it :s.
Oh oke. And this is probaly the lib http://maven-repository.com/artifact/com.typesafe/config/1.2.0 we need to play with . Looks good.
Linked it already above AND in the start post:
I misunderstand the gdoc table …
sk planned to use:
It is already shaded into Forge.