Running a separate process from a Java program

Hello again,

I might have said earlier that I'm writing a simple command line parser. Well it's not so simple anymore as I've gradually expanded the code after learning new things that could optimize the code.

Now I've come to the question of making the code scalable, I want to do this in the simplest possible way and that is in my opinion not having to recompile the parser at all.

My way of solving this (theory only) is to make the commands completely independent from the parser and the main program itself. This so that I can add a command while running the command.

My idea is to make each command a separate class inherited from a generic command class. The available commands are to be read from a file and in order to expand the command list this file will have to edited as well. The command will the be precompiled and added to the folder where the commands are kept. Each and every command will have it's own main method, unless it can be avoided somehow.

The parser will then be rebuilt using an internal command, this means that it will re-read the file of available commands and including the new one in the list.

The commands will be executed in new thread. My question is, can this be done?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!