dcsimg
<strong>Java API for compilation of programs</strong>
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Eric_Rivera
Posted On:   Friday, December 7, 2001 06:42 AM

Is there is an API that allows you to compile from a java program? If not, is this possible from within a java application? And how can I monitor the output of the compilation? I am writing a program that gathers data and rules from databases, files and user inputs, and I need to create and compile class modules in order to handle the same type of data next time. Because there are new rules for each new data type I need to create the classes to handle them, compile, and save the class name to a database where the main programs use it in order to handle the data. Any help would be appreciated. Thanks, ER    More>>

Is there is an API that allows you to compile from a java program? If not, is this possible from within a java application? And how can I monitor the output of the compilation?

I am writing a program that gathers data and rules from databases, files and user inputs, and I need to create and compile class modules in order to handle the same type of data next time. Because there are new rules for each new data type I need to create the classes to handle them, compile, and save the class name to a database where the main programs use it in order to handle the data.



Any help would be appreciated.

Thanks,

ER

   <<Less

Re: <strong>Java API for compilation of programs</strong>

Posted By:   Steve_Long  
Posted On:   Saturday, December 8, 2001 06:47 PM

I think you could use the java external application API to request the operating system run an executeable as a job (say a Java compiler). The specific executable in your case would be a (Java) compiler.

The parameters would be the source file and compiler options. Depending on the specific compiler, your driver program could look for certain files in certain directories for output, read in the files, and process according to DB rules and file contents.

All of the information for a given compiler or program could be stored in the database.

Sounds interesting. Keep me posted if you would. Good luck!

Re: <strong>Java API for compilation of programs</strong>

Posted By:   Stephen_McConnell  
Posted On:   Friday, December 7, 2001 07:15 AM

Sounds like you have either coded in SmallTalk or need to code in SmallTalk, unless you change your design pattern.


Either that or create a new architecture where you are not creating classes on the fly...


Check out the Strategy design pattern or the Little Language design pattern in some books on Java Design Patterns. Also, check out some articles on Rules Engines... which is what you seem to want to build...


Stephen L. McConnell

CrossLogic

About | Sitemap | Contact