Michael Cox

Greenhorn
+ Follow
since Sep 04, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Cox

Phew.

After some time I am down from 150 classes and a 2.5Mb assignment jar file to..

75 classes and 780Kb assignment jar file.

For the record: in order of benefit...

  • Reducing the number and size of screenshot images and eliminating multiple copies e.g. in classes dir and source dir.
  • Reducing generated javadoc to protected only (but keeping private javadoc in the code)
  • Merging View and Controller components in the GUI and eliminating an MVC cluster for the configuration management.
  • Reducing the amount of object orientated "posturing" i.e. working to interfaces everywhere , having factories for everything. All the code changes were made with no reduction in functionality whatsoever - I only removed pattern-inspired "bloat".


  • Think I went a bit mad - the downside of having no deadline and wanting to do really well!

    Many thanks for all your comments above.

    Michael
    I'm still having pre-submission wobbles about this one.

    Just because there is a mandatory DB interface does that mean that your RMI Remote interface offered to clients has to look the same?

    (perhaps only with the addition of throwing RemoteException)

    Currently my database object does implement the mandatory DB interface, but I wrap that database class in another class which offers a very different remote interface.

    Be grateful for further assurances that I'm not cruising to automatic failure through misinterpreting the instructions.

    Michael
    My assignment jar is 2.5Mb :-(

    So I'm in big trouble. I'm going to boil my code to reduce but also..

    The part of the jar occupied by the javadoc is huge I'm sure I can make savings but of course the assignment javadoc instructions are incomplete, contradictory etc:

    Javadoc style comments must be used for each element of the public interface of each class

    OK - no problem with that.

    You must create a full suite of documentation for the classes

    I must do it - but what do I read into "full suite". Can I turn off javadoc index, tree and use to save a bit of space or would that not be considered to be full suite?

    provide javadoc documentation for all classes you write...subdirectory containing javadoc documentation for all classes and interfaces you are submitting

    Many of my classes are private inner classes or package protected classes. If I use -public modifier when generating javadoc these classes will be skipped. if I use -private than I'm reporting on private members too.

    Does this mean I'm going to have to make all my classes public - that would seem very bad OO.

    Michael
    Damn - I was so busy focussing on the assignment instructions I totally overlooked the 200K-400K recommendation from the assignment email.

    Thanks very much for pointing that out.

    Michael
    Thanks for your thoughts guys.

    Definitely going to try and trim the design choices.

    And as for code:

    Well I did go big time for a framework - used MVC and tried to work to interfaces always - hence the number of interfaces.

    The GUI code in particular involved many classes - probably about 75% of the overall classes.

    The number of classes doesn't include anonymous classes and in fact I generally avoid those like the plague and create inner classes instead. Reason being that I think they make for horrible looking code. That increase in the number of inner classes probably accounts for some of the big numbers.

    I guess I was sort of hoping that my total lines of source would be ok even if the number of classes was large.

    Maybe lines of source code is a better metric of how much I may have overcooked the goose.

    Time to trim some of the fat perhaps unless someone says "don't worry I submitted 12000 lnes of code and did OK" :-)
    Hi,

    Bodgitt and Scarper 2.1.1

    "Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available."

    I felt it was really bad to do this to a GUI user so my locking solution puts uses a lock request with a timeout. This puts the lock in a TIMED_WAIT rather than a WAIT state.

    I'm pretty sure that consumes no CPU cycles but its not really blocking until the resource is available.

    And of course now I'm about to submit and I'm in a flap about this.

    Its says "should" rather than "must" which helps.

    Does anyone have any good/bad experiences submitting this sort of approach?

    Michael
    Hi,

    Bodgitt and Scarper 2.1.1

    "...javadoc style comments must be used for each element of the public interface of each class. You must create a full suite of documentation for the classes of the completed project. This must be generated using the tool "javadoc" and must be in HTML format. Provide javadoc documentation for all classes you write".

    I find the above requirement confusing so I have written javadoc comments for every class, method and field private or public or otherwise.

    (which amount to 579 pages when viewed as PDF - though I do have 150 classes).

    Should I only generate javadoc html with -public to avoid sending too much?

    Many thanks for any advice.

    Michael
    Hi,

    Bodgitt and Scarper 2.1.1

    All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.

    Should the properties file exist in advance with some reasonable defaults or is it ok that a first run forces uses to enter all properties?

    Also if the server and clients are run from the same place the same properties file will be used.

    Should each app have its own version of the individual properties or can they share?

    e.g the server and standalone client both use a database file - currently I only have one property storing a file name.

    Do people have any thoughts on these two issues?

    Many thanks,

    Michael
    Hi,

    Bodgitt and scarper 2.1.1 says:

    "Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface"

    Does mean that this interface must be the one I offer to remote clients?

    Or can I wrap the DB class in another class and offer a better interface to my remote client?

    Be grateful for your thoughts and experiences,

    Regards,

    Michael
    Hi All,

    B&S version 2.1.1 says:

    "Code complexity, including nesting depth, argument passing, and the number of classes and interfaces, should be reasonable"

    I wondering what they mean by "reasonable" and if I have gone too far and will fail because of that:

    Some stats on my completed assignment:

    Number of classes/interfaces: 151 classes of which 28 interfaces
    Average class source lines: 58 (max 334)
    Average method source lines: 8 (max 88)
    Total source lines of code: 6900
    Total javadoc lines of code: 6523

    Average number of arguments: 0.92 (max 7)
    Average nesting depth: 0.51 (max 5)
    Average cyclometric complexity: 1.51 (between 1 and 2.75 across packages)
    Total cyclometric complexity: 1054 (between 8 and 125 across packages)
    Coupling factor 4.48%

    (stats from MetricsReloaded - but there are so many complexity measures - which one)

    Size of choices document: 16 pages or 5500 words
    Size of user guides: 32 pages
    Size of javadoc: 579 pages (when converted to PDF)

    Many thanks in advance for any thoughts and experiences.

    Michael