RSS feed [root] /design /weblog




login:

password:

title search:




 


Thu May 23 22:45:24 HKT 2019

design



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

Thu Dec 03 10:33:50 HKT 2015 From /weblog/design/interview

UncleBob


http://www.infoq.com/news/2015/11/uncle-bob-oath-programmer

(google search) (amazon search)


Fri Nov 13 00:07:00 HKT 2015 From /weblog/design

memory


It won't happened at java, but for non-GC language like C++, crash at constructor will cause memory leak: http://blogs.asman-it.com.au[..]oders-have-it-easy-crashing-constructors

Discussion of if there are way to recover OOME - http://dobbscodetalk.com[..]-a-Non-Recoverable-Error-.html&Itemid=29

http://blog.maxindelicato.com[..]ghly-available-inmemory-shard-index.html

Discussion about using memory as store - http://martinfowler.com/bliki/MemoryImage.html

When using direct memory can be faster, when you have a large amounts of data and/or you have to perform some IO with that data. Tick data is a good example - http://vanillajava.blogspot.com.au[..]n-using-direct-memory-can-be-faster.html

http://www.memorymanagement.org/index.html

(google search) (amazon search)


Wed Sep 30 15:29:04 HKT 2015 From /weblog/design/pattern

tutorial


Collection of patterns from objectmentor - http://bradapp.blogspot.com[..]07/agile-scm-principles-from-ood-to.html

Robert Martin tutorial - http://www.java.net/pub/au/90

Links and abstract of few principle - http://www.surfscranton.com/Architecture/JavaPages.htm

Tutorial about common anti-pattern - http://giorgiosironi.blogspot.com/2009/11/anti-patterns.html

Development of Further Patterns of Enterprise Application Architecture - http://martinfowler.com/eaaDev/

Expanation and C++/Java samples - http://www.vincehuston.org/dp/

Java tutorial - http://www.javacodegeeks.com/2015/09/java-design-patterns.html


(google search) (amazon search)


Thu Sep 10 14:18:31 HKT 2015 From /weblog/design/interview

Martin Odersky


One of the challenges we were facing is we wanted to be both functional and object-oriented. We had very early on the notion that immutable objects would become very, very important. Nowadays everybody talks about immutable objects, because people think they are a key part of the solution to the concurrency problems caused by multi-core computers. Everybody says, no matter what you do, you need to try to have as much of your code using immutable objects as possible. In Scala, we did that very early on. Five or six years ago, we started to think very hard about immutable objects. It actually turns out that a lot of the object-oriented field up to then identified objects with mutability. For them, mutable state and objects were one and the same: mutable state was an essential ingredient of objects. We had to, in essence, ween objects off of that notion, and there were some things we had to do to make that happen.

http://www.artima.com/scalazine/articles/goals_of_scala.html

(google search) (amazon search)


Sat Aug 15 23:06:06 HKT 2015 From /weblog/design

game


Introduction to AI of game - http://aigamedev.com/theory/online-adaptation-game-opponent

How to create angry bird - http://www.wildbunny.co.uk[..]11/06/07/how-to-make-angry-birds-part-2/

How to program breast in game - http://www.inside.com.tw[..]15/07/30/how-video-game-breasts-are-made

http://www.inside.com.tw[..]eveloper-nintendo-president-satoru-iwata

(google search) (amazon search)


Wed May 27 10:17:34 HKT 2015 From /weblog/design

YAGNI


When XP says "go for the simplest possible design", what does that mean?
1. Simplest possible design to IMPLEMENT?
1. Simplest possible design to UNDERSTAND LATER?

An thread discuss how far should we go. Seen most people agree what should be done is "Simplest possible design to TEST and IMPLEMENT"

http://groups.yahoo.com/group/extremeprogramming/message/90466

It apply on feature, not on quality - http://martinfowler.com/bliki/Yagni.html

(google search) (amazon search)


Wed Dec 31 19:11:17 HKT 2014 From /weblog/design/concurrency

issues


Case study of a parallel slowdown, and the analysis of how to find it out - http://webtide.intalio.com[..]2/avoiding-parallel-slowdown-in-jetty-9/

Discuss about the racing condition when multiple accessing java.util.HashMap - http://mailinator.blogspot.com.au[..]au/2009/06/beautiful-race-condition.html

(google search) (amazon search)


Thu Dec 11 18:21:23 HKT 2014 From /weblog/design/pattern

notification


Sometime it is better to notify user about failing to validate input than throw - http://martinfowler.com[..]ticles/replaceThrowWithNotification.html

(google search) (amazon search)


Thu Sep 25 17:42:08 HKT 2014 From /weblog/design

datetime


Look like Java standard library already handle the 400 years leap day. However, there are still a lot to take care. - http://discuss.joelonsoftware.com/default.asp?design.4.326089

P.S.: an article about java timezone handling - http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time_p.html

Basic about computer time - http://blogs.windwardreports.com[..]ry-developer-should-know-about-time.html

Difference of time function provided by IPP - http://software.intel.com[..]g-function-for-measuring-ipp-api-timing/

Detail explanation of nano second and millisecond in java at windows platform - https://blogs.oracle.com[..]olmes/entry/inside_the_hotspot_vm_clocks

How to model thing that change with time - http://www.martinfowler.com/ap2/timeNarrative.html

Timezone handling issues of most application - http://martinfowler.com/bliki/TimeZoneUncertainty.html


(google search) (amazon search)


Thu Sep 18 14:47:54 HKT 2014 From /weblog/design

write shy code


Writing shy code is just a small start at preventing the introduction of bugs, but it really helps. Just as in the real world, good fences make good neighbor - as long as you don't peek through them.

http://www.computer.org/software/homepage/2003/s1const.htm
http://www.pragmaticprogrammer.com/ppllc/papers/1998_05.html

Other than that, there is also security risk if you show too much to other - http://www.indicthreads.com[..]_or_objects_java_security_problem_1.html

An example of why passing Map around is wrong and show solution of that example - http://antagonisticpleiotropy.blogspot.com[..]spot.com/2008/01/hashmap-temptation.html

Quoting from Getting Method in Beck’s 1997 Smalltalk Best Practice Patterns (emphasis his): “Here’s the real secret of writing good Getting Methods - make them private at first. I cannot stress this enough. … There are cases where you will publish the existence of Getting Methods for use in the outside world. You should make a conscious decision to do this after considering all the alternatives. It is preferable to give an object more responsibility, rather than have it act like a data structure.”
Quoting from Setting Method: “Everything I said once about Getting Methods, I’d like to say twice about Setting Methods. Setting Methods should be even more private. It is one thing for another object to tear out your state, it is quite another for it to bash in a new state.”

http://tech.groups.yahoo.com[..]om/group/domaindrivendesign/message/5701

East: Clean and DRY, an example of why tell don't ask help - http://jamesladdcode.com/?p=294

But personally, I don't use tell-dont-ask. I do look to co-locate data and behavior, which often leads to similar results. - http://martinfowler.com/bliki/TellDontAsk.html

Another discussion about getter and setter - http://www.yegor256.com[..]/09/16/getters-and-setters-are-evil.html

(google search) (amazon search)


Tue Aug 12 15:13:25 HKT 2014 From /weblog/design

prevent code debt


A nice article and nice term about prevent coding problem at first

http://www.stickyminds.com[..]bjectId=9860&tth=DYN&tt=siteemail&iDyn=2

In contrast, someone like to manage it - http://www.jamesshore.com[..]ardMeeting/Voluntary-Technical-Debt.html http://blogs.construx.com[..]archive/2007/11/01/technical-debt-2.aspx

Martin fowler's comment - http://martinfowler.com/bliki/DesignStaminaHypothesis.html

A blog about duplication is BAD - http://www.codinghorror.com/blog/archives/000805.html http://blog.objectmentor.com[..]/articles/2007/04/16/code-is-a-liability

Don't use feature-toggles - http://swreflections.blogspot.com.au[..]ture-toggles-are-one-of-worst-kinds.html

(google search) (amazon search)



Thu Jun 05 17:50:25 HKT 2014 From /weblog/design/concurrency

queue


Fast synchronization between a single producer and single consumer - http://www.bluebytesoftware.com[..]eenASingleProducerAndSingleConsumer.aspx

Lock free queue idea. - http://groups.google.com[..]read/thread/82066179448783da?hl=en&pli=1

Use of Disruptor - http://www.infoq.com/presentations/Disruptor

Use of Queue - http://highscalability.com[..]ble-presents-queue-er-message-queue.html

Discuss about the "Railway approach" of producer consumer queue - http://www.infoq.com[..]ormance-Java-Inter-Thread-Communications http://bad-concurrency.blogspot.com.au[..]alternative-multi-producer-approach.html

Probably worth to consider replacing queue by actor - http://www.nurkiewicz.com[..]implifying-trading-system-with-akka.html

(google search) (amazon search)


Wed May 21 17:43:40 HKT 2014 From /weblog/design/examples

language


Discussion of some decision made for improvement of Java Interface at Java8 - http://blog.jooq.org[..]java-8-friday-language-design-is-subtle/

(google search) (amazon search)


Mon May 19 15:37:30 HKT 2014 From /weblog/design/examples

openssl


Show how TDD can help OpenSSL to prevent heartbleed if they do it at the first place - http://martinfowler.com/articles/testing-culture.html

(google search) (amazon search)


Fri Apr 25 10:38:41 HKT 2014 From /weblog/design/pattern

strategy


Using generic to prevent downcast for Strategy Pattern, every time we try to cast something, may be worth to consider generic first? - http://www.javaspecialists.co.za/archive/newsletter.do?issue=123

http://javarevisited.blogspot.com.au[..]te-and-strategy-design-pattern-java.html

(google search) (amazon search)


Mon Apr 14 11:43:47 HKT 2014 From /weblog/design/distribute

mapreduce


MapReduce patterns

Basic MapReduce Patterns
Counting and Summing
Collating
Filtering (“Grepping”), Parsing, and Validation
Distributed Task Execution
Sorting
Not-So-Basic MapReduce Patterns
Iterative Message Passing (Graph Processing)
Distinct Values (Unique Items Counting)
Cross-Correlation
Relational MapReduce Patterns
Selection
Projection
Union
Intersection
Difference
GroupBy and Aggregation
Joining

- http://highlyscalable.wordpress.com[..]press.com/2012/02/01/mapreduce-patterns/

Showing that map reduce can support real time transaction processing - http://googleblog.blogspot.com[..]09/12/relevance-meets-real-time-web.html

Using map-reduce in cloud - http://horicky.blogspot.com/2010/02/cloud-mapreduce-tricks.html

Papers of using mapreduce - http://atbrox.com[..]thms-in-academic-papers-may-2010-update/ http://code.google.com/edu/parallel/mapreduce-tutorial.html

mapreduce experiment - http://www.macs.hw.ac.uk/~rs46/multicore_challenge1/

Pattern and anti-pattern - http://developer.yahoo.com[..]/2010/08/apache_hadoop_best_practices_a/ http://blog.dynatrace.com[..]bout-the-performance-of-map-reduce-jobs/

http://techalpine.com/what-are-the-hadoop-mapreduce-concepts/

(google search) (amazon search)


Fri Apr 11 16:26:11 HKT 2014 From /weblog/design/distribute

cloud


1. Use Cloud for Scaling
2. Use Cloud for Multi-tenancy
3. Use Cloud for Batch processing
4. Use Cloud for Storage
5. Use Cloud for Communication

http://horicky.blogspot.com/2009/11/cloud-computing-patterns.html

http://horicky.blogspot.com/2009/11/nosql-patterns.html

Database in cloud - http://drdobbs.com[..]int?articleId=218900502&siteSectionName=

An overview of the Hadoop/MapReduce/HBase framework and its current applications in bioinformatics - http://www.biomedcentral.com/1471-2105/11/S12/S1

The architecture that survived when amazon outage - http://www.infoq.com/news/2011/04/twilio-cloud-architecture

Introduction of few tools for cloud development - http://blog.codecentric.de[..]/01/best-development-tools-in-the-cloud/ http://www.javacodegeeks.com[..]/07/developing-and-testing-in-cloud.html

Google Finds: Centralized Control, Distributed Data Architectures Work Better than Fully Decentralized Architectures - http://highscalability.com[..]control-distributed-data-architectu.html

(google search) (amazon search)


Wed Mar 19 10:56:41 HKT 2014 From /weblog/design

copyAndPaste


Really? I would rather say every line of code need to maintain - http://www.javacodegeeks.com[..]s-copy-and-paste-programming-really.html

Data, Type, Algorithm - http://www.dotnetcodegeeks.com[..]012/05/types-of-duplication-in-code.html

Using closure to prevent code duplication - http://dublintech.blogspot.com.au[..]com.au/2014/03/good-use-of-closures.html

"Duplicated code is the root of all evil in software design. When a system is littered with many snippets of identical, or nearly identical code, it is indicative of sloppiness, carelessness, and sheer unprofessionalism. It is the guilt-edged responsibility of all software developers to root out and eliminate duplication whenever they find it." - http://edmundkirwan.com/general/duplication.html

(google search) (amazon search)


Thu Mar 13 16:22:34 HKT 2014 From /weblog/design

style


Discussion of style of writing code, like always have valuable for return value, and use return for parameter check - http://www.beust.com/weblog/archives/000308.html

We should really delete the code if we need to... http://nedbatchelder.com/text/deleting-code.html

And more about programming style - http://www.codinghorror.com/blog/archives/001184.html http://www.onextrapixel.com[..]for-keeping-your-programming-code-clean/

About using Of() as factory name - http://blog.joda.org/2011/09/factory-names.html

http://blog.jooq.org[..]-subtle-best-practices-when-coding-java/

http://blog.activelylazy.co.uk[..]uk/2014/03/10/are-comments-always-wrong/

(google search) (amazon search)


Wed Mar 12 13:37:40 HKT 2014 From /weblog/design/pattern

builder


http://www.petrikainulainen.net[..]-reasons-why-i-like-the-builder-pattern/ <- and it is not Silver Bullet

(google search) (amazon search)


Wed Mar 05 16:42:02 HKT 2014 From /weblog/design/distribute

whatapp


http://highscalability.com[..]ture-facebook-bought-for-19-billion.html

(google search) (amazon search)


Thu Jan 09 10:40:28 HKT 2014 From /weblog/design/interview

Maurice Herlihy


http://teachingintrotocs.blogspot.fr[..]012/05/interview-of-maurice-herlihy.html

(google search) (amazon search)


Mon Dec 23 18:06:30 HKT 2013 From /weblog/design/distribute

Idempotence


Sample chater of REST book , which contain a nice discussion of why Idempotence is important - http://www.infoq.com[..]dson-ruby-restful-ws/en/resources/04.pdf

New Acid:
* A – Associative
* C – Commutative
* I – Idempotent
* D - Distributed

http://www.eaipatterns.com/ramblings/68_acid.html

Idempotency patterns - http://jonathan-oliver.blogspot.com[..]ot.com/2010/04/idempotency-patterns.html

Detailed discussion about how to design Idempotence - http://queue.acm.org/detail.cfm?id=2187821

Discuss about clock in distributed environment - http://basho.com[..]e-bad-or-welcome-to-distributed-systems/

(google search) (amazon search)


Fri Dec 20 12:17:18 HKT 2013 From /weblog/design/distribute

overload


Solution #1: Have More Resources than You'll Ever Need
Solution #2: Disable Features During High Loads
Solution #3: Auto Scaling
Solution #4: Use Message Queues

http://blog.iron.io[..]spikability-applications-ability-to.html

http://highscalability.com[..]izing-and-capacity-planning-assumin.html

(google search) (amazon search)