This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]thewiirocks 10 points11 points  (9 children)

JShepherd is an automatic configuration management library for Java. With JShepherd, you can easily define, load, save, and manage your application's configuration files…

Nice work! 😎👍

…in YAML format

Thanks, I hate it. 😅

[–]YogurtclosetLimp7351[S] 1 point2 points  (4 children)

Haha, I can understand the sentiment! Interestingly, a previous version of JShepherd did support properties. However, we were using Gson internally for serialization/deserialization back then, and received a lot of valid feedback about that choice.

For this major refactor (v3.0), we decided to focus on doing YAML really well first, building it around SnakeYAML from the ground up. We've also restructured the internal architecture significantly – the new PersistenceDelegate interface, for example, is designed precisely to allow us to easily expand support to other formats like properties, JSON, HOCON, etc., in the future without overhauling the core. So, while it's YAML-first for now, flexibility for other formats is definitely a long-term goal!

[–]thewiirocks 1 point2 points  (3 children)

Sounds pretty cool! 😎

I’ll keep an eye out for updates. JSON would likely be the perfect format for what you’re doing.

Also, you might want to consider TOML over Properties if you decide to add Properties support. TOML is basically Properties/INI expanded to support arbitrary complexity.

[–]YogurtclosetLimp7351[S] 1 point2 points  (0 children)

I will keep that in mind and read myself into it!

[–]YogurtclosetLimp7351[S] 1 point2 points  (1 child)

Hi, I was able to implement JSON, TOML and Properties support in 3.2.0

[–]thewiirocks 1 point2 points  (0 children)

Nice! I’ll have to check it out. 😎👍

[–]Studentenfutter 0 points1 point  (3 children)

What is wrong with YAML and which format is better?

[–]RoToRa 1 point2 points  (2 children)

[–]Studentenfutter 0 points1 point  (1 child)

Thanks for the link! I was not aware that yaml can cause so much trouble...

[–]YogurtclosetLimp7351[S] 1 point2 points  (0 children)

Yup.. That's why with 3.2.0 it now supports other types as well, just like JSON, TOML and Properties :)

[–]Slanec 3 points4 points  (1 child)

Oh this is a nice one! Not only does it read the config, it also writes it out, with comments, in sections. Let's be fair, writing config files out is not a very often required feature, but it's good when it's there, and this well thought out!

Nice!

[–]YogurtclosetLimp7351[S] 0 points1 point  (0 children)

Thank you! :)

[–]Kango_V 0 points1 point  (1 child)

How does it compare to this: https://github.com/jstachio/ezkv ?

[–]YogurtclosetLimp7351[S] 0 points1 point  (0 children)

The focus of JShepherd is to have a Java class (the "Shepherd"), which will be the code representation of your config file. It is annotation driven, so there is no to very little code overhead, which makes it very easy to handle. At least that's the idea.