IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: Anybody want to do a Java code review?
A number of comments after a quick glance:
For all your collections you used a linked list, why? Do you need to do alot of removes? If not, an ArrayList is probably better.
Also, every time you add something you first check if it is there already, if so why not use a Set which doesn't allow duplicates?

In your collection find methods you have the following code:
foundit:
while(i.hasNext())
{

theCurrent = (CustomerPO)i.next();
if (theCustomer == theCurrent.getCustomerID())
{
if (POID == theCurrent.getCustomerPONumber())
{
break foundit;
}
}
}
if (i.hasNext())
{
return theCurrent;
}
else
{
return null;
}

A number of questions/comments:
1. Why do you need the break, once you have found the entry why not just return it?
2. What happens if the element that you find is the last one, i.hasNext() will be false but you still found the element.

You synchronized alot of methods, but not all of them, for example, you synchronized all the setAddress methods but none of the setPerson methods, do you expect to have many threads updating an address at the same time? If you do the synchronization might not help, take the following example: both Thread 1 and Thread 2 want to update Street Address 1 and 2. Thread 1 updates Address 1 then goes to sleep thread 2 updates Address 1 (Thread 1 is finished) and Address 2. Thread 1 then updates Address 2 (because thread 2 finished). The end result is that Address 1 has the new address that thread 2 entered and address 2 has the new address that thread 1 entered, in short the address is not consistent.

I don't really see where all the pieces fit together, what will drive the system?
New This is exactly why I need the review.
Only four people signed up for the course, so it got changed to a "Distance Learning" course.

This means that we have the reading list, the homework, and a professor who checks in with us about twice during the entire quarter. I've sent him my work, and nothing ever comes back.

The book I have ([link|http://www.bookpool.com/.x/dg4ptys7x1/sm/0130819344|Core Java Volume II - Advanced Features]) does everything in a very incremental way, and doesn't even really go into detail on any one particular feature of the API.

The way I'd like it:

"This is a collection. There are these types of collection. In each subsection below, we'll detail what each collection does and how it builds on the previous collection."

How they do it:

"This is a list. This is a linked list. This is a stack. This is a..."

And so on, and so on, and so on - without any real cohesion.

I need a real book.

Back to the code:

The Break I threw in there at two in the morning when I couldn't remember if returning out of a loop was a Bad Practice. I'll change that. A Set is probably is a better idea for this as well - I'm just a crusty old pointer boy who happens to like linked lists. Call me Pointerizer. ^_^

Good catch on the .hasNext function - looks like that won't work. Same with the address stuff - I'll probably stick address changes into a single function.

The front end for all this is a (still under design) GUI - hence my call for a book that actually explains AWT/Swing. I just figured out how ActionListeners work last night at about 11 (when my perception of reality was swimming dangerously close to Douglas Adams territory, so I probably have it wrong) so that part is making sense.

(FYI - I'm using the Forte community IDE - but don't worry, Malraux, I'm not using any of the integrated tools. I bashed around with the GUI design tools for about three minutes and realized I'd probably make more headway writing the !$!%%^## code by hand, at least until I understand how the damn API works.)

The problem I'm having with Java mainly links back to the "trying to take a sip from Niagra Falls" problem - there's so much out there, and they dump it on you so quickly, that I'm drowning...
"He who fights with monsters might take care lest he thereby become a monster. And if you gaze for long into an abyss, the abyss gazes also into you." - Friedrich Nietzsche
     Anybody want to do a Java code review? - (inthane-chan) - (13)
         Of the top of my head.... - (ChrisR)
         Re: Anybody want to do a Java code review? - (bluke) - (1)
             This is exactly why I need the review. - (inthane-chan)
         Couple comments - (tuberculosis) - (8)
             Thanks - (inthane-chan) - (6)
                 questions - (tablizer) - (5)
                     Purchase Order ID is specified by the purchaser, i.e... - (a6l6e6x) - (4)
                         That is an external ID - (tablizer) - (3)
                             Yep. You got it. -NT - (a6l6e6x) - (2)
                                 Then why not simply keep it an attrib instd of object? -NT - (tablizer) - (1)
                                     Excellent place for code reuse. - (inthane-chan)
             Good comments - (admin)
         Re: Anybody want to do a Java code review? - (bri)

#include <stdlrpd.h>
50 ms