Marcus Beale

Ranch Hand
+ Follow
since Apr 13, 2004
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 Marcus Beale

Anyone who says to use Context or a simple editor has not tried a better IDE. For java development there are MUCH better choices. They will save you time and effort (Javadoc creation, jar file creation, auto imports - you don't know how much time that saves until you try it, compilation and compiling in one environment, auto compiling to indicate syntax errors on the fly, auto completion, etc.

It's easy not to generate code. Don't use the GUI editors.

Oracle's JDeveloper is my personal favorite. It's free for personal use. Just do a google search. Beware though, Oracle will call you if you put in a company name in the download form.
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 ]
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 ]
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

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 ]
Some people have advocated listing buzzwords on your resume, which is fine. I think that you should only list buzzwords that apply to your work you have done. DON'T just list buzzwords you have heard. Buzzwords are funny, some people have no clue what they mean, others understand them intemately. It's easy to tell one from the other, don't look like a fool at your interview by listing things you don't fully understand. That includes swing etc.
Having said that, it's import to list your experiences in buzzword terminology. Understand how your experiences can be converted into buzzwords. I'll never forget an interview I had with Microsoft back in 1999. The HR person was asking if I had experience at ECommerce. I came right out and told them it was a buzz word and asked them what exactly did them mean. The HR person looked at me very strangely and basically assumed I had no clue what ECommerce was. You say ECommerce, I say webpage server with a JSP enginee with business logic server with a MySQL backend. I didn't get the job.
Another thing to mention, don't list buzzwords if you don't want to do that in your new job! I have some oracle experience installing and using the application server. However I never want to use oracle again, so I don't list Oracle9iAS on my resume.
If you are having problem formating your resume, go to the book store and buy a resume almanac. I got Adams Resume Almanac for 13 bucks at the local bookstore. It was worth about 8 times that amount. If your in school you can probably look at all kinds of sample resumes at the career center, but I still recommend getting your own copy.
19 years ago
Marlene,

That design looks pretty slick. If anyone uses it, post a message here and let us know how it goes.


You would have to be careful not to initialize any RMI objects in local mode.



I meant to make sure the design didn't initalize the RMI registry or something that would cause networking to occur. I don't think using a "Remote Object" would be an issue. (It better not be because I already turned in my asignment and I was doing that in the original design!) I'm guessing to test this project Sun will replace the networking libraries in java with some empty classes that simply throw exceptions and log network acccess attempts to a file. If any network attemtps are found when running your program in local mode, you get an automatic failure.
[ August 23, 2004: Message edited by: Marcus Beale ]
Marlene,


(As one more thought experiment, we could toss out CD and export CS. Then CS would actually be a remote object.)



Awsome idea!

However I don't think it would work for my code as is. I have a little bit of additional logic in CD, mainly related to starting and stopping the server. I wonder if there would be anyway to move that to CS without abusing the class abstract. Maybe move it to another class, but that would probably end up looking alot like CD. Mmmm.. food for thought.
You would have to be careful not to initialize any RMI objects in local mode.

PS. Before anyone decides to move to a bussiness server (3 tier approach) read this thread:
2 tier vs 3 tier
Marlene,

I agree with your logic. I never considered that CS is a remote object. It's pretty easy to export a remote object that doesn't extend URO:



The stub still has to be put in the RMI registery (or have it accessible from another exported remote object), before anyone can access it remotely.

I don't however, think the design violates the Sun spec, since a remote stub for CS is never created/exported, thus no networking is performed.

The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.



REFERENCES
RMI reference: Getting Started RMI
[ August 22, 2004: Message edited by: Marcus Beale ]
Marlene,

Does the interface ContractorAccess implement Remote?


Yes it does.

Interesting post.

I believe that the logic of your decision to split the B Interface, means you should have B inherit from RemoteB (not the other way around). This is because you are basically saying that certain public methods should not be accessible remotely. RemoteB may have fewer methods than B, therefore B should implement RemoteB. Otherwise there is no reason to split the interfaces.

Now if you take the above argument to be true, I believe the design now has a problem. You now have to address which interface should be returned by the Server Factory used by the client code. There are two interfaces that could be returned by the factory method B or RemoteB. Which one should be used? I believe that you will have to use the RemoteB interface in remote mode and the B interface in local mode. This defeats the purpose of the factory.

I understand the reason you want to split the B Interface, but I think it shouldn't apply in the context of a Business Server. Business Servers usually (at least mine does) have pretty highlevel methods. I don't believe you will have any B interface methods that you would not want to be accessed remotely. Notice I didn't say public methods; a implimentation of the B interface can have a bunch of public methods that shouldn't be accessed through the B interface and thus not remotely.

, Marcus
[ August 22, 2004: Message edited by: Marcus Beale ]
My design has a business logic server that uses the Data class. This way, my database can extend the DBAccess interface unaltered (aka without Remote Exceptions), but my business logic server can implement an interface of my choosing.



The client gets a reference to ContractorAccess from a Factory. This reference could be either a ContractorSearch (local mode) or a ContractorDeamon (remote mode). The client always has to deal with RemoteExceptions even in local mode. Anotherwords the same client code works for both modes.

, Marcus

PS. I hope this ASCII art comes out alright. Wish we had a preview button.
[ August 21, 2004: Message edited by: Marcus Beale ]
I submitted my assignment July 26. I'm still waiting! That's about 27 days. Maybe sun is backed up.
Surasak,

You are doing a linear search through your records, so either of your solutions is good. However if you were doing a more sophisticated search algorithm the order of records might be important and you would want to use the code sample that synchronized over the whole for loop. This is the approach I would take.

Does anyone know if there is a significant performance penalty for acquiring the lock on an object repeatedly? (I know there is some performance penalty - otherwise every method would be synchronized.) In your first code sample you are reacquiring the lock each time through the loop. In your second code sample you only get the lock once. I'm guessing choosing the correct approach will be based on a number of factors - the total number of records, the number of expected threads, the threading strategy used by the VM (how often are threads swapped out), etc.

, Marcus
Andrew,

You are correct, the middleware should be thread safe. It's a good point that I hadn't really considered. I spent a while reviewing the middleware and have come to the conclusion that it is thread safe without really trying. Although I can see a few spots where problems would exist if I allowed more functionity (such as adding and deleting records). All the state information in the middleware is stored in local variables, immutable objects, or thread safe objects. Some objects don't need to be thread safe since they are never shared between threads. This is probably more by chance than anything else.

, Marcus
Yeo,

But take a look at what information is updated when user books a record - it only needs to set the customer id only, so why commit the change to all the other unaffected values?



I not only use the update method for booking, but after I do a book, I completely redo the last search. I'm sure you would consider this very inefficent, but remember that you are working in a multi threaded environment. It's nice to keep the user somewhat in sync with what everyone else has booked since the last time he hit search button. Not to mention what happens when someone else has already booked the record in question - you don't want a error dialog to appear, but your search results to sill look like it should have worked...

,Marcus