Unihedro / JavaBot

Java based chat bot that runs in Java room of Stack Overflow Chat.
Apache License 2.0
15 stars 4 forks source link

Extract config from Class into configuration file #15

Closed Vogel612 closed 9 years ago

Vogel612 commented 9 years ago

Currently we are all ignoring the BotConfig.java. That locks down the class into a specific position and adds needless hindrances for moving it around.

It would be beneficial to allow parsing the bot configurations from a config-file on startup and then just keep them in memory. The configuration should be plain-text and at least be explained in the ABOUT (possibly including example configuration)

Unihedro commented 9 years ago

I vote for YAML.

fge commented 9 years ago

And why not just JSON? There are a lot more libraries out there supporting JSON; moreover, gson is in the dependencies

mangstadt commented 9 years ago

This being Java, I suggest a .properties file. :)

On Wed, Nov 12, 2014 at 8:43 AM, Vogel612 notifications@github.com wrote:

Currently we are all ignoring the BotConfig.java. That locks down the class into a specific position and adds needless hindrances for moving it around.

It would be beneficial to allow parsing the bot configurations from a config-file on startup and then just keep them in memory. The configuration should be plain-text and at least be explained in the ABOUT (possibly including example configuration)

— Reply to this email directly or view it on GitHub https://github.com/Vincentyification/JavaBot/issues/15.

Mike Angstadt Assistant Electronic Resources Librarian, Computer Lab Montgomery County-Norristown Public Library 1001 Powell Street | Norristown, PA 19401 610-278-5100 x141 www.mc-npl.org Like us on Facebook http://www.facebook.com/mcnplonline

Any views or opinions expressed in this e-mail are those of the sender and not necessarily coincide with those of the organization.The information in this email is confidential. The contents may not be disclosed or used by anyone other than the addressee. If you are not the intended recipient, please notify us immediately at the above address.

fge commented 9 years ago

@mangstadt for plain text, "one level only" properties such a solution is fine; however, it is not very extensible, and difficult to map to POJOs.

JSON, on the other hand, already has this covered. And it is an IETF standard, unlike YAML.

Vogel612 commented 9 years ago

@fge I don't understand the point you are trying to make... we don't even need POJOs for some 3 settings we have right now. I am with mangstadt here...

Vogel612 commented 9 years ago

A possibility (using a .properties file) as first draft can be seen on 7af6350

mangstadt commented 9 years ago

Thanks for the work but, Umm, you know there's a "java.util.Properties" class for parsing .properties files... xD

On Thu, Nov 13, 2014 at 12:23 PM, Vogel612 notifications@github.com wrote:

A possibility (using a .properties file) as first draft can be seen on 7af6350 https://github.com/Vincentyification/JavaBot/commit/7af63507b4117d7aeceba4d7baffc9d2119613e1

— Reply to this email directly or view it on GitHub https://github.com/Vincentyification/JavaBot/issues/15#issuecomment-62930805 .

Mike Angstadt Assistant Electronic Resources Librarian, Computer Lab Montgomery County-Norristown Public Library 1001 Powell Street | Norristown, PA 19401 610-278-5100 x141 www.mc-npl.org Like us on Facebook http://www.facebook.com/mcnplonline

Any views or opinions expressed in this e-mail are those of the sender and not necessarily coincide with those of the organization.The information in this email is confidential. The contents may not be disclosed or used by anyone other than the addressee. If you are not the intended recipient, please notify us immediately at the above address.

Vogel612 commented 9 years ago

Closed as completed since finished merge of #20