Wed Sep 02 16:28:22 GMT 2009 From /weblog/design
composition over inheritance
Good example of composition over inheritance - http://www.javablogging.com/comparable-vs-comparator/
(google search) (amazon search)
download zip of files only Wed Sep 02 16:28:22 GMT 2009 From /weblog/design composition over inheritanceGood example of composition over inheritance - http://www.javablogging.com/comparable-vs-comparator/ (google search) (amazon search) Wed Jun 25 01:59:02 GMT 2008 From /weblog/design/exception problem of using exception for control flowOther than harder to read, this approach is easier to have side effect, consider the following case:
The idea is, for any database problem, just return default value. However, if someone change the interface of NotFoundException to public final class NotFoundException extends RuntimeException {....} Then it break service() silencely :-/ Some to it is better to have
(google search) (amazon search) Tue May 06 06:25:04 GMT 2008 From /weblog/design/interview Donald KnuthDonald Knuth on Multi-Core, Unit Testing, Literate Programming, and XP:
http://www.artima.com/forums/flat.jsp?forum=276&thread=229705 (google search) (amazon search) Mon Apr 28 17:46:55 GMT 2008 From /weblog/design/interview Bjarne StroustrupNice message cover DSL, IDE, multiple dispatch, message passing, and more http://msdn2.microsoft.com/en-us/magazine/cc500572.aspx (google search) (amazon search) Mon Mar 17 17:25:25 GMT 2008 From /weblog/design/examples suggestion of search engine improvementNice suggestions, I think this can apply to most search function Don’t tell me everything you know - limit to specific set of datas , like ameture / professional Ask me the next most reasonable question Offer me to establish my search identity http://jooto.com[..]008/01/05/how-to-improve-search-engines/ (google search) (amazon search) Mon Mar 17 17:25:24 GMT 2008 From /weblog/design/exception Handle exception at eventTo prevent no one notice there is problem What the code is trying to do is make sure is that any exception thrown is brought to the attention of the user. I’ve been looking at a few approaches to help catch and handle these exceptions without the developer having to explicitly catch them at the UI level. You can create your own EventQueue, and have it catch uncaught exceptions when dispatching methods http://www.magpiebrain.com[..]2004/07/21/catching-uncaught-exceptions/ (google search) (amazon search) Fri Dec 14 04:03:17 GMT 2007 From /weblog/design sortingShow a design of how to write a map that store data at disk and do sorting - http://mattfleming.com/node/53 User friendly sort , "100" should be sort after "10" - http://www.codinghorror.com/blog/archives/001018.html (google search) (amazon search) Wed Dec 12 10:38:08 GMT 2007 From /weblog/design qconsf2007 summary, include discussion about distributed, dsl, arhitecture, XP, ... and many others - http://www.infoq.com/articles/qconsf-2007-summary (google search) (amazon search) Tue Dec 11 09:50:05 GMT 2007 From /weblog/design stringDiscussion about search and replace for a lot of files - http://discuss.joelonsoftware.com/default.asp?design.4.570350 (google search) (amazon search) Thu Dec 06 08:34:42 GMT 2007 From /weblog/design reportTDD reporting system Only introduce framework when it is needed - http://xprogramming.com/xpmag/dbcCallingTheShot.htm Process of improving - http://xprogramming.com/xpmag/dbcLjuticMonoGun.htm Introduce reflection - http://xprogramming.com/xpmag/dbcLjuticRefactoring.htm (google search) (amazon search) Sat Dec 01 08:18:17 GMT 2007 From /weblog/design convention over configurationMake it is easier for user to working with your API / framework - http://www.google.com[..]uration&sourceid=opera&ie=utf-8&oe=utf-8 (google search) (amazon search) Wed Nov 21 06:20:13 GMT 2007 From /weblog/design booleanTry 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 08:06:21 GMT 2007 From /weblog/design non-blockingA 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 15:32:58 GMT 2007 From /weblog/design/interview Martin Fowler interviewThe 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 15:30:06 GMT 2007 From /weblog/design starting pointWhere 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 11:06:25 GMT 2007 From /weblog/design reusesome 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) Wed Sep 12 18:01:25 GMT 2007 From /weblog/design Transactional memorySomeone 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 05:33:09 GMT 2007 From /weblog/design typingDiscussion 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) Tue Aug 21 16:57:24 GMT 2007 From /weblog/design/pattern surveySurvey 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) Thu Aug 09 17:59:30 GMT 2007 From /weblog/design/interview Erich GammaErich 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 15:45:23 GMT 2007 From /weblog/design binary searchSimple and fast - http://www.tbray.org/ongoing/When/200x/2003/03/22/Binary Possible bug, fix and lesson learnt - http://searchforquality.blogspot.com[..]ot.com/2007/06/very-interesting-bug.html http://googleresearch.blogspot.com[..]xtra-extra-read-all-about-it-nearly.html (google search) (amazon search) Thu Jul 12 11:35:52 GMT 2007 From /weblog/design/IoC spring discussionDiscuss 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 08:20:21 GMT 2007 From /weblog/design/exception anti-pattern of exceptionMostly 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) Wed Jun 13 17:14:39 GMT 2007 From /weblog/design/exception check or uncheckChecked 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) Thu May 03 07:09:00 GMT 2007 From /weblog/design configurationAn useful discussion about that balancing config and coding http://worsethanfailure.com/Comments/Soft_Coding.aspx (google search) (amazon search) |