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

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)



Mon Jul 07 18:32:35 HKT 2014 From /weblog/design/examples

messaging


ZeroMQ: The Design of Messaging Middleware - http://www.drdobbs.com[..]&siteSectionName=architecture-and-design

When NOT to use a message queue - http://techblog.bozho.net/?p=1455

(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)


Wed Dec 11 09:16:42 HKT 2013 From /weblog/design

batch


Batch processing best practices - http://vladmihalcea.wordpress.com[..]013/10/30/scheduled-jobs-best-practices/

Batch can improve latency, if it reduce number of request - http://highscalability.com[..]ng-requests-actually-reduce-latency.html

(google search) (amazon search)


Wed Nov 06 12:37:46 HKT 2013 From /weblog/design

web


Good REST API - http://horicky.blogspot.com/2012/03/designing-robust-web-api.html http://www.infoq.com/presentations/Building-a-Great-Web-API

Discussion of page object - http://martinfowler.com/bliki/PageObject.html

Difference API document tools - http://www.infoq.com/research/api-documentation

(google search) (amazon search)


Fri Nov 01 14:28:59 HKT 2013 From /weblog/design/examples

ebay


Key points

1) No stored procedures are used. There are some very simple triggers.
2) Move cpu-intensive work moved out of the database layer to applications applications layer: referential integrity, joins, sorting done in the application layer! Reasoning: app servers are cheap, databases are the bottleneck.
3) No client-side transactions. no distributed transactions
4) J2EE: use servlets, JDBC, connection pools (with rewrite). Not much else.
5) No state information in application tier. Transient state maintained in cookie or scratch database.

http://highscalability.com/ebay-architecture

How ebay use Cassandra - http://www.infoq.com[..]-practice-of-cassandra-data-model-design http://www.infoq.com[..]ctices-cassandra-data-model-design-part2 http://www.ebaytechblog.com[..]dra-data-modeling-best-practices-part-1/ http://www.ebaytechblog.com[..]dra-data-modeling-best-practices-part-2/

(google search) (amazon search)


Tue Oct 29 17:54:03 HKT 2013 From /weblog/design/distribute

feed


http://highscalability.com[..]for-scaling-your-high-traffic-feeds.html

(google search) (amazon search)


Thu Oct 24 17:01:36 HKT 2013 From /weblog/design/examples

ide


http://www.infoq.com/articles/codenvy-architecture-part-1
http://www.infoq.com/articles/codenvy-architecture-part-2

(google search) (amazon search)


Fri Oct 18 14:22:38 HKT 2013 From /weblog/design/distribute

nosql


Compare SQL ( RDBMS ) and noSQL ( object base {distributed??} ) data management - http://queue.acm.org/detail.cfm?id=1961297&ref=fullrss

The definition - http://martinfowler.com/bliki/NosqlDefinition.html http://martinfowler.com/articles/nosqlKeyPoints.html

Is Cassandra really that good? - http://www.datastax.com/dev/blog/2012-in-review-performance

http://martinfowler.com/articles/bigData/

NoSQL Options Compared - http://www.drdobbs.com[..]cleId=240151198&siteSectionName=database

A 3 Step Guide to Getting Started with NoSQL - http://jyops.blogspot.com.au[..]-step-guide-to-getting-started-with.html

SAFER THAN RDBMSs – BUILT FOR DISASTER AVOIDANCE - The http://www.datastax.com[..]/10/why-nosql-can-be-safer-than-an-rdbms

(google search) (amazon search)