Solved

Example of modular Java code for non-web applications

Posted on 2010-09-13
2
643 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

708 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

13 Experts available now in Live!

Get 1:1 Help Now