aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes GUI 29 out of 40!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "GUI 29 out of 40!!!" Watch "GUI 29 out of 40!!!" New topic
Author

GUI 29 out of 40!!!

Marcus Beale
Ranch Hand

Joined: Apr 13, 2004
Posts: 33
I just got my score for the SCJD:

General Considerations (maximum = 100): 99
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 30
GUI (maximum = 40): 29
Locking (maximum = 80): 80
Data store (maximum = 40): 40
Network server (maximum = 40): 40

I can't believe that I was deducted points for my GUI!!! I thought I had a very nice GUI. I modeled it after Limewire's old GUI. Compared to some of the GUI design I've heard people describe, I'm baffled. Maybe my grader didn't feel they couldn’t give me close to a perfect score - that's not fair! I'm wondering if it would be ok to post a screenshot of my GUI here and have people critique it? (Andrew, Phil?)

Does anyone know if the grading of the GUI is based on the code’s structure or the user interface? Admittedly my GUI code was not beautiful, but I have never seen any GUI code that is. I used Action classes. I made a custom model for my JTable. I had a GUI for both the client and server.

BTW: Please spare me the Congratulation posts. I'm sure you are all very happy for me and I'm happy for me - enough said. As for the details of my design, I can give you a rough overview after I get some answers about my GUI questions (Probably in another thread, I’ll post here with a link).

PS. Thanks for all the helpful post JavaRanchers!
[ August 26, 2004: Message edited by: Marcus Beale ]
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
How come you are overlooking the more important fact here - that YOU PASSED?
[ August 26, 2004: Message edited by: Anton Golovin ]

Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11484
    
  94

Hi Marcus,

I'm wondering if it would be ok to post a screenshot of my GUI here and have people critique it? (Andrew, Phil?)


I don't see a problem with that in this case.

Normally we discourage screenshots, but in this case, you are posting something that is known to have lost 11 points, so there is less danger of someone copying it for their own design. So as something everyone can learn from, this could be a good exercise.

Please be aware that the current JavaRanch BBS software does not allow images to be uploaded (the next generation may be a different matter), so you will have to put your images somewhere else on the WWW, and then use the [IMG]....[/IMG] tags to inline them.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Marcus Beale
Ranch Hand

Joined: Apr 13, 2004
Posts: 33
Anton,
I'm very happy I passed! I'm just a little shocked at the results. I hope everyone (myself included) can learn from my GUI mistakes.

Andrew,
Ok sounds good to me. Below is the screenshot of my client GUI.

I was thinking about my general design. I kept the server very generic by supporting multiple database schemas (not just the Contractor Schema). The current schema is passed to the GUI once it connects to a server. The GUI uses the current schema to display query fields and search result columns. It could be the generic nature of my GUI that lost me points, since I didn't customize it very much for Contractors.

A dialog box appears when connecting to a server (from the Network menu) or when booking contractors (Pressing the book button).

, Marcus

peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
Your GUI looks ok to me, here are a few ui questions that can't be answered from a static picture:

- does it resize properly, including very small?

- if a command were to take a very long time could you still shut down the client? Are there ways it can get unresponsive?

- did you use threads? if you did, did you use invokeLater?

- if there are multiple ways to issue commands did you use the Action interface.
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hi,Marcus

Congratulations!

Your GUI above looks well and contains all components.
But only a frame is not enough to analyze the shortage in it.

Although the GUI might be not ideal,your totle score is GREAT!
Would you like to share your design experiences in other parts of your assignment?

Thanks in advance.


Regards, Richard
Uwe Wichmann
Greenhorn

Joined: Feb 01, 2002
Posts: 6
If I may add a few thoughts as to why you might have lost points:

1) I'm not sure it's a good idea having the search facility on the same frame as the rest of it. Maybe only a "simple search" on the main window, with a button to do an "advanced search"...

2) The edit boxes touch the sides of the frame without there being a border around them. Looks awkward.

3) Ditto the "Contractor" part. Maybe center-aligning them might be a good idea...

Anyway, just my two cents' worth.

Don't bite my head off.
mike acre
Ranch Hand

Joined: Sep 23, 2003
Posts: 197
Pretty sure there's at least 1 mark in having a 'File' menu named as such.


SCJP 1.4, SCJD
Marcus Beale
Ranch Hand

Joined: Apr 13, 2004
Posts: 33
Peter,

The GUI does resize well.

I do use invokeLater (you should always use invokeLater since any java application with a GUI has multiple threads that could interact).

I did not provide a means for the user to cancel a long search. I considered this, but decided that it would add too much complexity to the code and wasn't really required. Maybe I should have.

I make extensive use of the Action interface.

Uwe,

Maybe there should have been an advanced search option. I'm not a big fan of that in GUIs, since I usually want to use the advanced search (especially if I was a CSR and used this application constantly).

The boxes touching the frame I think is a pretty arbitrary criteria. I doubt sun would grade us on things like that - how could they make it consistent? ( I do agree with you however.)

The center-aligning of the Details section is a good idea.

Mike,

I was thinking about the naming of that menu also. "Network" isn't a very good name, especially since you can have a local connection. "File" isn't so great either, since I'm not always opening a file. I had one dialog when “connect” was selected from the menu (there was also a disconnect option). There was a checkbox to allow the "local" option on the dialog. Perhaps I should have use two separate dialogs for each connection mode. Maybe File->Open for the local connection and Server->Connect for a remote connection.

-------------------------------------------------------------------------

I'm beginning to think I probably lost most of my GUI points from the GUI code. My main Client class was about 800 lines with 7 private classes (mostly action classes) and three anonymous classes. Maybe that was too much code for one class.
[ August 27, 2004: Message edited by: Marcus Beale ]
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
Originally posted by Marcus Beale:
Peter,

The GUI does resize well.

I do use invokeLater (you should always use invokeLater since any java application with a GUI has multiple threads that could interact).

I did not provide a means for the user to cancel a long search. I considered this, but decided that it would add too much complexity to the code and wasn't really required. Maybe I should have.

I make extensive use of the Action interface.

Uwe,

Maybe there should have been an advanced search option. I'm not a big fan of that in GUIs, since I usually want to use the advanced search (especially if I was a CSR and used this application constantly).

The boxes touching the frame I think is a pretty arbitrary criteria. I doubt sun would grade us on things like that - how could they make it consistent? ( I do agree with you however.)

The center-aligning of the Details section is a good idea.

Mike,

I was thinking about the naming of that menu also. "Network" isn't a very good name, especially since you can have a local connection. "File" isn't so great either, since I'm not always opening a file. I had one dialog when “connect” was selected from the menu (there was also a disconnect option). There was a checkbox to allow the "local" option on the dialog. Perhaps I should have use two separate dialogs for each connection mode. Maybe File->Open for the local connection and Server->Connect for a remote connection.

-------------------------------------------------------------------------

I'm beginning to think I probably lost most of my GUI points from the GUI code. My main Client class was about 800 lines with 7 private classes (mostly action classes) and three anonymous classes. Maybe that was too much code for one class.

[ August 27, 2004: Message edited by: Marcus Beale ]


It sounds like all the dynamic stuff is right in your GUI, so maybe its the UI standards violations that got you. I think your GUI looks fine, but it isn't standard.

It is standard practice to provide the File, Edit and Help menus. Actions about network and properties usually go in File, since a socket is a kind of file in *Nix. Actions such as "search" and "book" would go in Edit and "help" and "about" would go in Help.

Letting textfields slam against a border is probably wrong, and I'd tend to right justify the labels so they are close to the text fields. Possibly all the space devoted to the search and details panes cost you. I intend to give all the real estate to the table and only bring up search and book dialogs when needed.

To get an idea of how a GUI should look, take a look at your browser or some of the M$ products such as Excel or Word. IBM actually published documents on this topic, but their Lotus Notes product is probably one of the worst GUIs I've used.

I don't think they would deduct points from GUI for a 800 line class, I'd take those off General, but that is very long. Anything over about 200 lines is difficult to follow unless its mostly javadoc.
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hi Marcus,

I understand where you're coming from with regard to dropping marks unexpectedly. For some people just to pass is not good enough, though we sometimes have to settle for it in the end.

Personally I don't think your GUI design is bad, but there's enough wrong with it IMHO not to warrant full marks. I would mark you down on the following points:
  • Lack of File menu - I like your Network menu idea but you need File too as it's effectively a Windows UI convention.
  • Text fields and labels flush with borders (no padding) - that's just poor UI design; I can't imagine a client accepting that, can you?
  • Search button is miles away from the fields (bad UI design)
  • Numeric values are typically right-aligned in lists (minor)
  • Field labels should be mixed case as it's easier to read (not just my opinion) (minor)
  • Field sizes are not consistent between Search and Details panes (minor)
  • List is a little cramped; needs a little more spacing (minor)
  • Layout just doesn't feel natural, i.e. task progression is not top-to-bottom/left-to-right. This is not just a personal preference thing, it's recommended practice for designing a UI. I would expect to have Search at the top with Results List and Booking selection below. I personally feel that the Details area is a bit superfluous as all the info is available in the list.


  • Obviously it's impossible to say whether that would constitute 11 marks and presumably some would depend on the quality of the code and whether you've implemented stuff like input validation, etc. You've given yourself an extra potential headache by adding search fields that were not required. You won't be given extra credit, as the spec says, but you may have been marked down if you allow any old crap in the rate field, for example. Can't see you making that mistake though really.

    I think it's hard for some of us guys who spend most of our time doing server-side stuff to care about the UI. I always tell my project managers not to let developers design user interfaces.

    Hope you find these comments useful/interesting.

    Jules
    mike acre
    Ranch Hand

    Joined: Sep 23, 2003
    Posts: 197
    Re: long gui code

    A main view class with controller elements aka main frame and private action classes; is very difficult to OO-ify, boiler plate, 1 off code.
    You are going to get a long class if it is anything other than a trivial application. If you split it in to classes then you risk obfuscation.
    Personally I have 1 main frame class with about 600 CLOC and 1 table class with 300 CLOC. Delegation between them means the controller class just talks to MainFrame. There is alot of delegation, and I think a balance needs to be struck between too much delegation and too many view classes.
    Though I do think 800+, even 5000 lines of code in one main view class is a valid approach for boiler plate code. This is even more relevent to the controller class.

    Concerning reuse of the view.
    I no one person passed 40/40 for little refgard to reuse in the view.
    I'm not suprised. a/ sun say use standard elements - ie don't extend JTable etc b/ from the spec - it should end up a very trivial gui, that will be easier to basically replace than extend. Fact!
    Marcus Beale
    Ranch Hand

    Joined: Apr 13, 2004
    Posts: 33
    Mike,

    I agree with you. I prefer to have all the GUI components handy in one file - it something I've started doing more recently.
    I feel that to do a true MVC approach is way out of scope for the certification. I've had some experience with creating MVC frameworks through work. In the spec, sun says something about building GUI framework to support future changes. I don't think what Sun intended is a MVC framework.
    You are correct about inheritance not being all it's cracked up to be. The Gang of Four book and Effective Java both say to favor composition over inheritance when possible.

    Julian,

    Excellent comments. Good point about the Search button being so far away and the general layout. You probably hit on at least half the points.
    I come from more of a Information Visualization background than User Interfaces. I think of InfoVis as the fun part of UI. I designed the GUI using Overview/Details (I hate dialog boxes). But in reality I don't think people don't naturally understand Overview/Details.

    Peter,
    It's unfortunate that M$ products are used for GUI templates, but you are correct. There are so many cool innovations people have come up with for GUIs that M$ keeps from becoming mainstream. The Mac has changed some of that, but hopefully Sun's Java Desktop will blow them all away. I feel like GUIs are stuck in the 90s. (I'll stop my ranting now.)


    Thanks for the good comments everyone!
    [ August 28, 2004: Message edited by: Marcus Beale ]
    Jason Hocker
    Ranch Hand

    Joined: Jul 23, 2003
    Posts: 132
    I wasn't planning on having any menus... are you saying that I must have "windows" type menus?
    Paul Bourdeaux
    Ranch Hand

    Joined: May 24, 2004
    Posts: 783
    I wasn't planning on having any menus... are you saying that I must have "windows" type menus?
    IMHO, I would recommend including the standard menus such as File, Edit... Even if you are not a Microsoft fan, the fact remains that MS is by far the most widely distributed operating system, and the interface associated with a windows application has become the defacto standard.

    To add to the bit about Human-Computer Interaction that Max touches on in his excellent book: As a user becomes accustomed to a particular command sequence which is common across programs (for example, Ctrl-C to copy) the sequence becomes part of the user's muscle memory. In essence, they adopt a "mode" of standard command sequences when using the computer. Software that forces a user to switch to a different mode is generally not considered to be good interface design, even though the application itself may be more efficient without including the extra information the user is used to. (For instance, think about how much it would slow you down if suddenly Ctrl-C no longer mapped to the _C_opy command, but instead to the _C_lose command...)

    When designing an interface, you should take your user into consideration, and, when possible, design to the mode they are used to. If they often use a windows based environment, then you should put the standard windows menus in it.


    “Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
    peter wooster
    Ranch Hand

    Joined: Jun 13, 2004
    Posts: 1033
    For instance, think about how much it would slow you down if suddenly Ctrl-C no longer mapped to the _C_opy command, but instead to the _C_lose command.


    I'd just switch to my old Unix habits.
    Ed Green
    Greenhorn

    Joined: Jun 15, 2004
    Posts: 11
    Hello all,
    I'm not trying to start a flame war, but...
    If 95% of the users are expecting to see certain common features and interaction models from a user interface, especially, as we are told for this assignment, these will be not-so-techy customer service reps, and eventually users themselves, the ui had _better_ follow the expected behaviour conventions, or it will end up (1) rewritten or (2) thrown out. I'm personally modeling my ui and its behaviour after excel, because i _know_ that (1) it has millions of users who are not complaining loudly enough to stop M$ sales, and (2) there are hundreds of usability experts who get paid lots of money to make sure that (1) stays true for a looooong time.

    tnx.
    peter wooster
    Ranch Hand

    Joined: Jun 13, 2004
    Posts: 1033
    Originally posted by Ed Green:
    Hello all,
    I'm not trying to start a flame war, but...
    If 95% of the users are expecting to see certain common features and interaction models from a user interface, especially, as we are told for this assignment, these will be not-so-techy customer service reps, and eventually users themselves, the ui had _better_ follow the expected behaviour conventions, or it will end up (1) rewritten or (2) thrown out. I'm personally modeling my ui and its behaviour after excel, because i _know_ that (1) it has millions of users who are not complaining loudly enough to stop M$ sales, and (2) there are hundreds of usability experts who get paid lots of money to make sure that (1) stays true for a looooong time.

    tnx.


    With my anti M$ flame thrower hanging in my holster, I reluctantly have to agree with you. MS/Excel wasn't designed by M$, it was purchased, and if there is one thing Bill knows, that's how to spend money to make more. Excel is very well designed and deals with tables that look a lot like ours. I'm using it as a model, for that reason when you load my client, it automatically pulls in the configured data, provides you with menus and uses dialogs and double clicking a row attempts to book it. I'll probably add accelerators, a right click pop-up menu and a toolbar, that will give me a chance to use the Action interface.
    Andrew Monkhouse
    author and jackaroo
    Marshal Commander

    Joined: Mar 28, 2003
    Posts: 11484
        
      94

    Originally posted by Paul Bourdeaux:
    For instance, think about how much it would slow you down if suddenly Ctrl-C no longer mapped to the _C_opy command, but instead to the _C_lose command.

    Originally posted by peter wooster:
    I'd just switch to my old Unix habits.


    Mmmm, I remember when I was concurrently editing files on a Vax VMS system and a Unix system. At the end of the edit session under VMS, I would type Ctrl-Z followed by "save". Except that Ctrl-Z in Unix stops the process. :roll:

    Back to the topic at hand though, it is also recommended that you use tool bars where possible - again, just because people are used to seeing them.

    Those still reading this thread might be interested in reading the comments in the "Cert nightmare" topic.

    Regards, Andrew
    Ed Green
    Greenhorn

    Joined: Jun 15, 2004
    Posts: 11
    Already got the right-click menu and accelerators covered Didn't think of the double click though, good point. You think they'll notice if i just write a plugin for java that'll let me just plug excel in?
    Paul Bourdeaux
    Ranch Hand

    Joined: May 24, 2004
    Posts: 783
    Didn't think of the double click though, good point.
    I hadn't thought of that either. Good call.
    Jason Hocker
    Ranch Hand

    Joined: Jul 23, 2003
    Posts: 132
    My thinking was that I would implement the least amount of functionality required, so that there would be less places where my code could be wrong.
    peter wooster
    Ranch Hand

    Joined: Jun 13, 2004
    Posts: 1033
    Originally posted by Jay Simpson:
    My thinking was that I would implement the least amount of functionality required, so that there would be less places where my code could be wrong.


    Using the Action interface helps with that, since all these different ways to cause an action end up using the same code.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: GUI 29 out of 40!!!