download zip of files only
Thu Mar 09 15:13:09 GMT 2017
From /weblog/design
Someone saying that having private method is anti-pattern, here is the discussion - http://www.infoq.com/news/2008/01/private-methods-tdd-design Discussion of encapsulation - http://niket-this.blogspot.com[..]/encapsulation-does-it-really-exist.html My view on this is that most of the time there's little value in self-encapsulation. The value of encapsulation is proportional to the scope of the data access. Classes are usually small (at least mine are) so direct access isn't going to be an issue within that scope. Most accessors are simple assignments for the setter and retrieval for the getter, so there's little value in using them internally. - https://martinfowler.com/bliki/SelfEncapsulation.html
(google search)
(amazon search)
Tue Feb 21 09:44:20 GMT 2017
From /weblog/design
A paper show the evolution of a DSL - http://www.mockobjects.com/files/evolving_an_edsl.ooplsa2006.pdf A stock trading order example of DSL - http://debasishg.blogspot.com[..]05/designing-internal-dsls-in-scala.html What is the difference between API / DSL if we don't write a parser for our language? From Martin Fowler's blog - http://martinfowler.com/bliki/DslReadings.html , it is mentioned: Piers Cawley makes the point that a key characteristic of DSLs is their narrow focus on a domain. I think this is a very good summary, usually if most of the APIs are getXXX() , setXXX(), loadXXX() , createXXX() ........ Then we mostly design APIs that expose low level detail to the API user to work on, which, is work but user probably work nicer if we can come up with language like API that allow users to do their work in more descriptive level. I think if API design like that usually it will reduce the code duplication, what ever real duplication or conceptual duplication. It probably already apply "Tell, don't ask" style - http://c2.com/cgi/wiki?TellDontAsk A discussion about applying "Tell, don't ask" which lead to message passing architecture - http://beautifulcode.oreillynet.com[..]07/10/do_messages_want_to_be_asynchr.php And other discussion about "Tell, don't ask" http://sriramnarayan.blogspot.com[..]/2008/11/demeters-law-tell-dont-ask.html http://sriramnarayan.blogspot.com[..]part-two-demeters-law-tell-dont-ask.html http://sriramnarayan.blogspot.com[..]rt-three-demeters-law-tell-dont-ask.html One good sample with explaination - http://hamletdarcy.blogspot.com[..]-it-really-domain-specific-language.html http://nat.truemesh.com/archives/000727.html Few links - http://dreamhead.blogbus.com/logs/17667876.html From CRUD to DDD - http://www.udidahan.com[..]2/15/from-crud-to-domain-driven-fluency/ I like this: "XML abuse reduction (conducting an “XML Intervention”)" - http://www.lostechies.com[..]ps-internal-dsl-draft-outline-notes.aspx DSL maybe the result of encapsulation - http://dreamhead.blogbus.com/logs/214225975.html Excellent implementation of extending java yourself - http://www.infoq.com/presentations/JetBrains-MPS-DSL http://www.infoq.com/presentations/JetBrains-MPS-DSL-2 How DSL method named - http://tech.pro[..]he-java-fluent-api-designer-crash-course https://tomassetti.me/domain-specific-languages/
(google search)
(amazon search)
Mon Jan 23 10:33:07 GMT 2017
From /weblog/design
Stealing thread - http://badamczewski.blogspot.com.au/2012/05/work-stealing.html Intel Guide for Developing Multithreaded Applications - http://software.intel.com[..]or-developing-multithreaded-applications Difference ways to stop a thread - http://www.ddj.com[..]ept_url=/hpc-high-performance-computing/ Interesting, I am not sure if I agree, but chrome ( which use fork ) are really cool in performance: There’s another problem with Unix programming in Ruby that I’ll just touch on briefly: Java people and Windows people. They’re going to tell you that fork(2) is bad because they don’t have it on their platform, or it sucks on their platform, or whatever, but it’s cool, you know, because they have native threads, and threads are like, way better anyways.
Fuck that.
Don’t ever let anyone tell you that fork(2) is bad. Thirty years from now, there will still be a fork(2) and a pipe(2) and a exec(2) and smart people will still be using them to solve hard problems reliably and predictably, just like they were thirty years ago.
MRI Ruby people need to accept, like Python (you have seen multiprocessing, yes?), that Unix processes are one of two techniques for achieving reliable concurrency and parallelism in server applications. Threads are out. You can use processes, or async/events, or both processes and async/events, but definitely not threads. Threads are out. http://tomayko.com/writings/unicorn-is-unix 1x1 win M*N - http://binkley.blogspot.com/2012/01/1-1-beats-n-m.html Best number of threads: N = number of CPUs U = target CPU utilization (0 <= U <= 1) W/C = ration of wait time to cpu time (measured through profiling) threads = N * U * (1 + W/C) - http://www.ibm.com/developerworks/library/j-jtp0730.html http://stackoverflow.com[..]ratio-of-java-threads-to-cpus-on-solaris Another post about tuning thread pool - http://www.javaadvent.com[..]ortance-of-tuning-your-thread-pools.html Threads Basics - http://www.hpl.hp.com/techreports/2009/HPL-2009-259html.html http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/threadsintro.html The Dos and Don'ts of Multithreading - http://www.infoq.com/presentations/multithreading https://www.infoq.com/articles/engstrand-microservice-threading http://cbloomrants.blogspot.hk[..]-26-09-low-level-threading-table-of.html
(google search)
(amazon search)
Mon Nov 28 16:12:57 GMT 2016
From /weblog/design/interview
"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)
Mon Sep 12 16:10:46 GMT 2016
From /weblog/design
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)
Thu Sep 10 06:18:31 GMT 2015
From /weblog/design/interview
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)
Wed Dec 31 11:11:17 GMT 2014
From /weblog/design
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
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 18 06:47:54 GMT 2014
From /weblog/design
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)
|