RSS feed [root] /design /weblog




login:

password:

title search:




 


Sun Oct 01 16:19:43 HKT 2017

design



(google search) (amazon search)
second
download zip of files only

Wed Nov 21 14:20:13 HKT 2007 From /weblog/design

boolean


Try not to have boolean at the interface - http://www.jroller.com[..]Ruiz/entry/boolean_arguments_can_be_evil

(google search) (amazon search)


Tue Nov 13 16:06:21 HKT 2007 From /weblog/design/concurrency

non-blocking


A few example of writing non-blocking thread safe method, mostly using the concept of Idempotency

http://mailinator.blogspot.com[..]readerwriter-in-java-in-nonblocking.html
http://www-128.ibm.com[..]works/java/library/j-jtp04186/index.html
http://blogs.azulsystems.com/cliff/2007/03/a_nonblocking_h.html
http://lalitpant.blogspot.com/2007/05/efficient-concurrency.html
http://en.wikipedia.org/wiki/Lock-free_and_wait-free_algorithms

Not exactly related, some project about non-blocking IO
http://twistedmatrix.com/trac/
https://grizzly.dev.java.net/

(google search) (amazon search)


Sun Nov 11 23:32:58 HKT 2007 From /weblog/design/interview

Martin Fowler interview


The discussion of "Flexibility and Complexity" and "Flexible versus Reusable" answer my long question of how to have flexibility code with simple design.

http://www.artima.com/intv/flexplexP.html

Another interview - http://www.infoq.com/presentations/modifiability-fowler

(google search) (amazon search)


Sun Nov 11 23:30:06 HKT 2007 From /weblog/design

starting point


Where do you start your design? UI? flow? Data? This is a very interesting discussion about this

http://www.theserverside.com/news/thread.tss?thread_id=44883

I think most likely start with UI is better, because it probably representing domain closer

(google search) (amazon search)


Fri Nov 09 19:06:25 HKT 2007 From /weblog/design

reuse


some common pitfall of code reuse - http://tomasvarsavsky.com/2007/07/26/wary-of-code-reuse/ http://www.infoq.com/news/2007/07/worthless-code

(google search) (amazon search)


Thu Sep 13 02:01:25 HKT 2007 From /weblog/design/concurrency

Transactional memory


Someone say the basic idea behind transactional memory is that memory is shared by all the threads in a read-only manner. Threads modify data by "committing" objects to shared memory. If a thread commits on top of a dirty object then it has to "rollback" and retry.

http://research.sun.com[..]007/2007-08-13_transactional_memory.html
http://www.hpcwire.com/hpc/1196095.html

(google search) (amazon search)


Fri Aug 24 13:33:09 HKT 2007 From /weblog/design

typing


Discussion of dynamic and static typing: http://www-128.ibm.com[..]orks/java/library/j-cb05236.html?ca=drs-

There are always arguement of having compilataion checking is good (safe) or bad (tedious), here is an example showing compilation checking is good - http://udidahan.weblogs.us/archives/036626.html

Another discussion - http://discuss.joelonsoftware.com/default.asp?joel.3.401797 http://blog.objectmentor.com[..]gly-typed-languages-considered-dangerous

Reference information of types - http://cdsmith.twu.net/types.html http://www.artima.com/weblogs/viewpost.jsp?thread=209353

(google search) (amazon search)


Wed Aug 22 00:57:24 HKT 2007 From /weblog/design/pattern

survey


Survey about how people feel about design pattern - http://www-etud.iro.umontreal.ca/~foutsekh/SomeResults.pdf http://tech.groups.yahoo.com/group/refactoring/message/8651

(google search) (amazon search)


Fri Aug 10 01:59:30 HKT 2007 From /weblog/design/interview

Erich Gamma


Erich Gamma: A pattern is always a problem-solution pair that can be applied in a particular context. Although the solutions might look similar in different patterns, the problems they are solving are different. In fact from ten thousand meters most patterns solve a problem by adding a level of indirection. What is interesting is how this indirection comes about and in particular why it needs to happen.
Therefore if you just look at the solution to the problem, it isn't that enlightening and everything starts to look the same. When we wrote design patterns we often had this feeling??hey all started to look like the Strategy pattern.

http://www.artima.com/lejava/articles/patterns_practice.html

(google search) (amazon search)



Thu Aug 02 00:30:11 HKT 2007 From /weblog/design

flow condition


i wonder if it makes sense to refactor from this:

public void someMethod(SomeClass someObject) {
if(someObject != null){
do something ...
}
}
to this:
public void someMethod(SomeClass someObject) {
if(someObject == null) return;
do something ...
}

http://groups.yahoo.com/group/refactoring/message/3385

The other discussion about flow control presentation - http://www.artima.com/forums/flat.jsp?forum=106&thread=211172

(google search) (amazon search)


Thu Jul 12 19:35:52 HKT 2007 From /weblog/design/IoC

spring discussion


Discuss the problem of using springs framework, it mainly complaint about the complication of spring, I will think people know what they are using, if it is too complex, just pick other

http://crazybob.org/2006/01/i-dont-get-spring.html

Another discussion complaint about spring - http://www.theserverside.com[..]_id=46041&asrc=EM_NLN_1757981&uid=703565

Some counter opinions to those complaints - http://jroller.com/page/wiradikusuma?anchor=5_reasons_why_i_won

(google search) (amazon search)


Thu Jul 12 16:20:21 HKT 2007 From /weblog/design/exception

anti-pattern of exception


Mostly agree, however, why do we need NoSuchMethodException? Why we don't just don't implement that method? If this is required by the interface, why we implement an interface but not complete the contact?

http://today.java.net[..]/06/exception-handling-antipatterns.html http://softarc.blogspot.com[..]06/exception-handling-anti-patterns.html

(google search) (amazon search)


Thu Jul 12 14:24:34 HKT 2007 From /weblog/design

Object attributes


About getter and setter - http://blog.milesbarr.com/2006/09/getters-and-setters/

Discussion of hashcode and equal of collections - http://redsolo.blogspot.com[..]11/why-no-equals-and-gethashcode-in.html

A blog discuss the problem of getter / setter - http://jroller.com[..]rise?entry=the_case_against_the_property

(google search) (amazon search)


Thu Jun 14 01:14:39 HKT 2007 From /weblog/design/exception

check or uncheck


Checked or unchecked? Not sure, seen all exception is unchecked are ok for me

To summarize Java orthodoxy: checked exceptions should be the norm. Runtime exceptions indicateprogramming errors.
I used to subscribe to this view. However, after writing and working with thousands of catch blocks, I've come to the conclusion that this appealing theory doesn't always work in practice. I'm not alone. Since developing my own ideas on the subject, I've noticed that Bruce Eckel, author of the classic book Thinking in Java, has also changed his mind. Eckel now advocates the use of runtime exceptions as the norm, and wonders whether checked exceptions should be dropped from Java as a failed experiment

http://www.mindview.net/Etc/Discussions/CheckedExceptions

Other discussion of checked or unchecked - http://www.theserverside.com/news/thread.tss?thread_id=35586 http://www.infoq.com[..]2007/05/removing-java-checked-exceptions

(google search) (amazon search)


Fri May 04 15:07:49 HKT 2007 From /weblog/design/exception

Why use exception instead of error code


A detailed explanation

http://gamearchitect.net/Articles/ExceptionsAndErrorCodes.html

(google search) (amazon search)


Thu May 03 15:09:00 HKT 2007 From /weblog/design

configuration


An useful discussion about that balancing config and coding

http://worsethanfailure.com/Comments/Soft_Coding.aspx

(google search) (amazon search)


Sun Apr 15 19:26:55 HKT 2007 From /weblog/design/interview

Interview of Netbean developers


Interview of netbean developers, I feel this is a lot more promotion than sharing of technology. However, these still valuable - http://blogs.sun.com[..]ree_interviews_with_language_programmers

(google search) (amazon search)


Thu Mar 01 15:26:27 HKT 2007 From /weblog/design

How to format parameter


Some will think boolean is ugly as parameter, I think if there is more than one boolean in parameter list - http://silkandspinach.net/blog/2004/07/hexagonal_soup.html

(google search) (amazon search)


Tue Feb 27 12:31:48 HKT 2007 From /weblog/design/exception

handle exception in finally


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 15:52:27 HKT 2006 From /weblog/design

inherence or composition


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 15:49:07 HKT 2006 From /weblog/design/interview

Ken Arnold 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 15:48:27 HKT 2006 From /weblog/design/interview

Pragmatic Programmer



*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 15:47:11 HKT 2006 From /weblog/design/interview

Scott Meyers 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)


Wed Oct 11 11:14:13 HKT 2006 From /weblog/design

Jay Flowers series


Jay Flowers have blogged a series of technique to achieve better testability design

http://jayflowers.com/WordPress/?p=78
http://jayflowers.com/WordPress/?p=79
http://jayflowers.com/WordPress/?p=81
http://jayflowers.com/WordPress/?p=85
http://jayflowers.com/WordPress/?p=86
http://jayflowers.com/WordPress/?p=89
http://jayflowers.com/WordPress/?p=91
http://jayflowers.com/WordPress/?p=92

The summary - http://jayflowers.com/WordPress/?p=93

(google search) (amazon search)