Code Structure


The following sections describe aspects of code structure and style that are often overlooked. It doesn't take much effort to follow a consistent and easy-to-understand organization, so I recommend the following ideas for your consideration.

Package Organization

This section explains how to package your classes for submitting your project. You should have only two, three, or at most four directories. More than that, and the evaluator will think you complicated your design needlessly. For example, you could use the following three packages:

 suncertify.client suncertify.dbatabase suncertify.server 

File Organization

Your filenames should clearly indicate the purpose of files in your project. For example, I added the following three classes to my project. The names alone are enough to explain what they do:

 suncertify.db.Database suncertify.db.DatabaseFactory suncertify.db.LockManager 

Be sure to group classes together by functionality.



JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net