RSS feed [root] /weblog /design




login:

password:

title search:




 


Thu Apr 06 06:32:51 GMT 2023

design



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

Wed Dec 07 10:48:22 GMT 2016 From /weblog/design

work with legacy


Simple ways to improve legacy code - http://www.onjava.com/lpt/a/4805

One approach to work with legacy code, instead of phrase by phrase or part by part, identify and improve the domain part first - http://gojko.net[..]-efforts-to-replace-legacy-systems-fail/

http://arne-mertz.de[..]egacy-applications-tests-modularization/

Note of common point for refactoring with legacy application - http://marxsoftware.blogspot.hk[..]/2016/10/unintentionally-obfuscated.html

(google search) (amazon search)


Mon Nov 28 16:12:57 GMT 2016 From /weblog/design/interview

Amazon


"They build their own infrastructure for performance, reliability, and cost control reasons. By building it themselves they never have to say Amazon went down because it was company X's fault. Their software may not be more reliable than others, but they can fix, debug, and deployment much quicker than when working with a 3rd party."

http://highscalability.com/amazon-architecture

Shel Kaphan - http://www.infoq.com/cn/articles/talk-with-amazon-shel-kaphan

(google search) (amazon search)


Tue Nov 15 02:53:50 GMT 2016 From /weblog/design

value object


Discussion of DTO - http://mrpmorris.blogspot.com/2009/01/data-transfer-objects.html

Discussion of value object - http://blog.joda.org/2014/03/valjos-value-java-objects.html http://martinfowler.com/bliki/ValueObject.html http://martinfowler.com/bliki/AliasingBug.html

(google search) (amazon search)


Wed Nov 02 08:14:20 GMT 2016 From /weblog/design/pattern

retry


understanding-retry-pattern-with-exponential-back-off-and-circuit-breaker-pattern - http://rahulrajatsingh.com[..]al-back-off-and-circuit-breaker-pattern/

(google search) (amazon search)


Wed Nov 02 08:13:31 GMT 2016 From /weblog/design

lock


10-ways-to-reduce-lock-contention-in-threaded-programs - http://www.thinkingparallel.com[..]ce-lock-contention-in-threaded-programs/

Discussion about lock the form and prevent 2 user edit it in the same time and currupt the object, what is the possible drawback. - http://www.dcmanges.com[..]-optimistic-locking-isnt-a-silver-bullet

futexes - http://en.wikipedia.org/wiki/Futex http://groups.google.com[..]ds/browse_thread/thread/3c3608a779dc6731

Spinning - http://www.1024cores.net[..]ome/lock-free-algorithms/tricks/spinning

Locks for rarely changed data, sound like good suggestion - https://groups.google.com[..]pic/comp.programming.threads/dyrbRKsj4gw

Try to use non-blocking approach if possible - http://mechanical-sympathy.blogspot.com[..]1/locks-condition-variables-latency.html

Concurrency without lock, and even without correctness? - http://splashcon.org/2011/program/dls/245-invited-talk-2

Single write principle - http://mechanical-sympathy.blogspot.com.au[..].au/2011/09/single-writer-principle.html

Comparing difference kind of locks again - http://concurrencyfreaks.blogspot.com.au[..]11/stampedlocktryoptimisticread-and.html

10-ways-to-reduce-lock-contention-in-threaded-programs - http://www.thinkingparallel.com[..]ce-lock-contention-in-threaded-programs/

(google search) (amazon search)


Sat Oct 15 17:52:15 GMT 2016 From /weblog/design/interview

yahoo


How yahoo use Hadoop for machine learning - https://www.infoq.com/articles/peter-cnudde-yahoo-big-data

(google search) (amazon search)


Mon Sep 12 16:10:46 GMT 2016 From /weblog/design

latency


http://highscalability.com[..]here-and-it-costs-you-sales-how-crush-it

*Do not use locks in the main transaction flow because they cause context switches, and therefore latency and unpredictable jitter.
*Never have more threads that need to run than you have cores available.
*Set affinity of threads to cores, or at least sockets, to avoid cache pollution by avoiding migration. This is particularly important when on a server class machine having multiple sockets because of the NUMA effect.
*Ensure uncontested access to any resource respecting the Single Writer Principle so that the likes of biased locking can be your friend.
*Keep call stacks reasonably small. Still more work to do here. If you are crazy enough to use Spring, then check out your call stacks to see what I mean! The garbage collector has to walk them finding reachable objects.
*Do not use finalizers.
*Keep garbage generation to modest levels. This applies to most JVMs but is likely not an issue for Zing.
*Ensure no disk IO on the main flow.
*Do a proper warm-up before beginning to measure.
*Do all the appropriate OS tunings for low-latency systems that are way beyond this blog. For example turn off C-States power management in the BIOS and watch out for RHEL 6 as it turns it back on without telling you!
*Macro-benchmarking is much more valuable than micro-benchmarking.
*Amazing results are achieved by truly agile companies, staffed by talented individuals, who are empowered to make things happen. Make sh*t happen is more important than following a process.

http://highscalability.com[..]ughput-by-32x-and-reduce-latency-by.html

http://bravenewgeek.com[..]rything-you-know-about-latency-is-wrong/

How to monitor - https://plumbr.eu[..]siness-value-from-performance-monitoring

How to measure latency - https://vanilla-java.github.io[..]/07/20/Latency-for-a-set-Throughput.html

Various cause of latency, and the solution - https://www.informatica.com[..]Topics-in-High-Performance-Messaging.htm

(google search) (amazon search)


Fri Sep 09 08:00:46 GMT 2016 From /weblog/design/examples

patching


How QQ deliver hotfix at Android - http://www.infoq.com/cn/articles/Android-hot-fix

(google search) (amazon search)


Tue Aug 16 16:06:59 GMT 2016 From /weblog/design/examples

linkedin


How linkedin handle logs - https://engineering.linkedin.com[..]ould-know-about-real-time-datas-unifying

(google search) (amazon search)



Wed Dec 09 03:20:40 GMT 2015 From /weblog/design

availability


https://www.pgrs.net/2013/02/21/high-availability-at-braintree/

https://medium.com[..]y-available-code-7eaf3d7aae00#.cbae171gy

(google search) (amazon search)


Thu Dec 03 02:33:50 GMT 2015 From /weblog/design/interview

UncleBob


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

(google search) (amazon search)


Thu Nov 12 16:07:00 GMT 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 07:29:04 GMT 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 06:18:31 GMT 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 15:06:06 GMT 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 Dec 31 11:11:17 GMT 2014 From /weblog/design

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 10:21:23 GMT 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 09:42:08 GMT 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 06:47:54 GMT 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 07:13:25 GMT 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)



Wed May 21 09:43:40 GMT 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 07:37:30 GMT 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 02:38:41 GMT 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)