Java; Runtime interpretation; Policies for adding plug-ins
I started my first big project It will be a program very similar to Rosetta stone It will be a program for learning a foreign language, written in Java using swing In my plan, I plan that users can choose to download courses to learn Because I am a native English speaker, I will be able to create an English course However, I hope that people who speak other languages can write courses for users (this is an important part of my course work)
Because I want users to download the language courses they want, it is impossible to hard code them into the program The course needs to be explained at runtime In addition, since I want others to cooperate with my work (i.e. making courses), I need to let them do so
What is the best way to do this?
The idea I came up with was a strictly empty syllabus (hard coded) and a simple XML file detailing the text and sound to be used The disadvantage of this is that it greatly limits the author Different languages may need to start with learning different parts
Any suggestions for the problem at hand and the whole project will be appreciated Any links to relevant resources or information will also be appreciated
Think about your time and energy,
Joseph pound
Solution
If you do this from scratch (will's idea is good), what I want to do is first put down the file format that is easiest to create a language course It can be XML, plain text or other format you came up with yourself
You may need some flexibility in language formatting because you want to be able to actually specify content such as questions and answers XML is painful because of all the extra terminators, but it provides a lot of metadata If you like XML, you can consider using YML definition language file, which will provide you with XML data, but use space descriptors instead of angle brackets
You may also want to use the language definition file it creates, so you may or may not want to use English words as keys If you don't want any English, you may have to skip XML and YML and propose your own file format – possibly where the layout and / or special symbols define streams and "functions"
Once the file format is defined, you don't have to worry about hard coding anything... You won't be able to hard code because it already exists in the file
The plug-in function is also very good... This is your definition file and contains information about the classes to instantiate (reflexively) and to parse / display data In this way, you can add new types of questions by providing new jar files
If it's confusing, sorry, it's difficult in one-way forums because I can't see your face to see if you follow me or if I'm moving in the right direction If you think I'm on the right track and want more details (I've done something like this before), please feel free to leave follow-up questions (or email address) in the comments, and I'll be happy to discuss it with you further