Solved

Example of modular Java code for non-web applications

Posted on 2010-09-13
2
646 Views
Last Modified: 2012-05-10
Greetings,

I'm looking for an example of simple modular code in Java. After quite some researching, I'm only finding complex examples and "full" packages which also utilize larger frameworks and such. It seems like there would be a much simpler solution.

I'm assuming some usage of reflection and such. The modules don't need security considerations; they will only be provided and written by in-house developers. The reflection and interfacing is cake, but what I'm largely confused about is how to get the classes loaded dynamically at run-time when the JAR files may be dropped in place at any time.
0
Comment
Question by:michael_martinek
2 Comments
 
LVL 1

Accepted Solution

by:
jatyap earned 250 total points
ID: 33668599
Since you mention that the JAR files can be dropped in place, I'm assuming you want to have something similar to how the Eclipse IDE handles their plugins?

Well, first off, you will need to specify a directory (or group of directories) which your application will treat as a plugin/dropin repository.

I'm not sure if this is what you want, but the following link shows how to load classes from JAR files at runtime. You can also call invoke on the methods, etc. (Basically whatever you can do with reflection)

http://www.javaworld.com/javaworld/javatips/jw-javatip70.html
0
 

Author Closing Comment

by:michael_martinek
ID: 33668685
Exactly it. Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now