download zip of files only
Tue Feb 27 04:31:48 GMT 2007
From /weblog/design/exception
This blog discuss the code at finally can affect code at catch block - http://mult.ifario.us/articles/2006/07/26/java-brain-teaser ExternalResource resource = resourceManager.open(); Throwable e1 = null; try { // Use the resource (stream, db connection, ...) } catch (Throwable e) { e1 = e; } finally { try { resource.close(); if (e1 != null) throw e1; } catch (Throwable e2) { // Pretend e2 doesn't already have a cause... if (e1 != null) e2.initCause(e1); throw e2; } } http://bagotricks.com[..]06/02/06/dropping-the-ball-er-exception/ or this, can be better looking try { InputStream is = new FileOutputStream("hello.txt"); try { is.write("hello"); finally { is.close(); } } catch (IOException e) { e.printStrackTrace(); }
http://jroller.com/page/davinci?entry=finally_in_catch
(google search)
(amazon search)
Thu Oct 12 07:52:27 GMT 2006
From /weblog/design
A great reading of the fundamental design decision: inherence or composition? http://groups.yahoo.com/group/extremeprogramming/message/67018 Delegation means that you include an instance of another class as an instance variable, and forward messages to the instance. It is often safer than inheritance because it forces you to think about each message you forward http://www.norvig.com/java-iaq.html#del2
(google search)
(amazon search)
Thu Oct 12 07:49:07 GMT 2006
From /weblog/design/interview
Have anyone read "Effective Java"? Compare the "item 10: Override clone judiciously" with this interview is fun http://www.artima.com/intv/issuesP.html No perfect design because we need difference design trade off for difference task, like performance, time, resource, .... No perfect design because difference user have difference expectation of API .... No perfect design because requirement change by time http://www.artima.com/intv/perfect.html
(google search)
(amazon search)
Thu Oct 12 07:48:27 GMT 2006
From /weblog/design/interview
*Dave Thomas*: You have to accept the fact that you're not going to get it right the first time. And you're not going to get it perfectly right the second or third time. You'll never get it perfectly right, but along the way you can get better and better . To do that, you have to discipline yourself to apply a reflective process to what you do. *Bill Venners*: What do you mean by reflective process? *Dave Thomas*: You always have to look back at what you did and ask, "How did I do that? Could I have done it better? Did I have to do it at all?" Get into the habit of doing that with everything you do. That way, you're consciously forcing yourself to reevaluate the way you do things. Full message: http://www.artima.com/intv/metadataP.html
(google search)
(amazon search)
Thu Oct 12 07:47:11 GMT 2006
From /weblog/design/interview
I think a schism existed between the C++ community, which was still focused on language issues, and the other prominent development communities, which pretty much left the language alone. Java already had exceptions, but didn't have templates and had nothing like the STL. Yet the Java community focused on writing a whole bunch of libraries that everybody can assume will exist everywhere, libraries that will let you write applications really quickly. The end result is, we have templates in C++, but there's no way to write user interfaces or talk to databases. Java has no templates, but you can write user interfaces up the wazoo and you can talk to databases with no trouble at all. http://www.artima.com/intv/abcsP.html
(google search)
(amazon search)
Tue May 09 05:04:30 GMT 2006
From /weblog/design
How about create a Class to hold all constant? How about static import? How about DON'T use it at all? http://hoskinator.blogspot.com[..]onstants-in-java-is-it-right-to-use.html
(google search)
(amazon search)
Sat Jan 14 17:11:21 GMT 2006
From /weblog/design/examples
An nice article provide a complicate solution of global search - "Domain Searching Using Visitors". I think you can guess from the name, it is a solution which is look nice and damn flexible. However, this also very complicate and not everyone like to do that much upfront design first. Anyway, a nice reading http://www.onjava.com/lpt/a/5927
(google search)
(amazon search)
Sun Jan 08 11:23:48 GMT 2006
From /weblog/design/exception
From a very good jpeg meta data extractor - http://drewnoakes.com/code/exif/
mention the solution at exception message
com.drew.metadata.MetadataException: Tag Image Width has not been set -- check using containsTag() first
at com.drew.metadata.Directory.getInt(Unknown Source)
(google search)
(amazon search)
Mon Nov 28 10:20:01 GMT 2005
From /weblog/design
Classes are to big ... * When it is unclear what the exact responsibility of the class is. (when apparently little changes in requirements often require changes in the same set of classes, time after time) * When it is difficult to write a unittest to test the behavior of the class. (very common for large classes that combine a lot of functionality) * When the concept of the class no longer fits the size of your head. (working on the class becomes difficult, meaning you need to scroll a lot, skip between various parts of the code in order to understand the class. Differs a little from person to person.) Kind Regards, Sven
(google search)
(amazon search)
Sun Oct 23 10:10:19 GMT 2005
From /weblog/design
This is the most practical UML drawing tool , contain eclipse plugin http://www.spinellis.gr/sw/umlgraph/
(google search)
(amazon search)
|