Right now I have a config reader class which goes through a text config file and adds values it finds to variables I have declared earlier. Then all these variables are passed to a constructor. Needless to say, its messy and it looks like this:
String buttonText = "";
String buttonPassword = "";
String buttonAction = "";
String buttonFont = "";
int buttonPosX = 0;
int buttonPosY = 0;
int buttonWidth = 0;
int buttonHeight = 0;
int buttonFontSize = 0;
int buttonFontColor = 0;
int buttonBgColor = 0;
int buttonLayoutPosition = 0;
// Gathering information here ...
parent.addButton(buttonText, buttonPassword, buttonPosX, buttonPosY, buttonLayoutPosition, buttonWidth, buttonHeight, buttonAction, buttonFont, buttonFontSize, buttonFontColor, buttonBgColor);
Is there a better way to do this? I've heard of maps, would this be a good location to use one? I want to keep efficiency in mind but also code readability and maintenance.