download zip of files only
Fri Jan 06 03:17:18 GMT 2023
From /weblog/design
i wonder if it makes sense to refactor from this: public void someMethod(SomeClass someObject) { if(someObject != null){ do something ... } } to this: public void someMethod(SomeClass someObject) { if(someObject == null) return; do something ... }
http://groups.yahoo.com/group/refactoring/message/3385 The other discussion about flow control presentation - http://www.artima.com/forums/flat.jsp?forum=106&thread=211172 A Response to “Stop Using If-Else Statements” - https://betterprogramming.pub[..]op-using-if-else-statements-c3d4c64c69af
(google search)
(amazon search)
Thu Nov 03 23:37:56 GMT 2022
From /weblog/design
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 Don’t write reusable code - https://medium.com[..]sb/dont-write-reusable-code-a857e925b683
(google search)
(amazon search)
Sun Sep 18 21:04:57 GMT 2022
From /weblog/design
Generally, how a search engine work - http://horicky.blogspot.com/2010/03/search-engine-basics.html Search engine logic - http://www.infoq.com[..]ne-scheduling-architecture-for-reference 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/ https://advancedweb.hu/intro-to-lucene/
(google search)
(amazon search)
Tue Jun 21 00:19:50 GMT 2022
From /weblog/design
A nice table:
Do
|
Don't
|
1. Focus on interfaces. |
2. Be worried about the implementation. |
3. Mention semantic contract using interfaces. |
4. Let subtypes break this semantic contract of their parent types. |
5. Service decoupling using interfaces. |
6. Be coupled with specific concrete implementation. |
7. Family extension using interfaces. |
8. Break the family relationship using concrete implementation. |
9. Establish a family rule by abstract classes. |
10. Impose your own rule through concrete classes. |
11. Let interfaces answer all "what" about the system. |
12. Forget to mention "how" are you answering all "what" from interfaces. |
Also a good introduction of Strategy pattern
http://today.java.net[..]/03/28/testing-java-object-oriented.html
How to determine the levels of abstraction - http://programmers.stackexchange.com[..]w-to-determine-the-levels-of-abstraction
Simple and clear, good design -> Correct, clear, easy to change - http://randomartifacts.blogspot.com.au[..]rrectness-clarity-and-changeability.html
Data Oriented Programming in Java - https://www.infoq.com/articles/data-oriented-programming-java/
(google search)
(amazon search)
Mon Feb 14 23:37:05 GMT 2022
From /weblog/design
How to write safer concurrency code - http://www.artima.com/forums/flat.jsp?forum=276&thread=178345 reentrant and thread safe functions - http://kevinrodrigues.com[..]/31/reentrant-and-thread-safe-functions/ Libraries / toolkits for multicore process - http://www.ddj.com[..]intableArticle.jhtml?articleID=212900103 Introduction - http://www.ddj.com[..]QQSNDLRSKHSCJUNN2JVN?articleID=212903586 http://www.ddj.com[..]CQSNDLRSKHSCJUNN2JVN?articleID=213001517 Collections of links - http://dobbscodetalk.com[..]rallel-Or-Get-Left-Behind.html&Itemid=29 Briefing of difference modeling of threading system - http://www.ddj.com[..]intableArticle.jhtml?articleID=215900465 http://software.intel.com[..]inners-guide-to-multithreaded-libraries/ http://natishalom.typepad.com[..]haloms_blog/2010/08/concurrency-101.html Saving the Failwhale: The Art of Concurrency (Page last updated December 2012, Added 2012-12-26, Author Dhanji R. Prasanna, Publisher informit). Tips: 1) Contention is unavoidable - some resources are just slower, and you must wait for them. The secrets to good concurrency are 1) ensuring that these slower resources are rarely used, and 2) during such waiting periods, giving the faster tiers other work to do so that they continue to be utilized well. 2) Overuse of synchronization constructs such as locks and mutexes leads to systems that perform poorly under load. 3) ConcurrentHashMap is an efficient thread-safe map while HashMap is not thread-safe. 4) ConcurrentHashMap doesn't do away with locks, it still uses them but it uses more than the single global lock, so that threads gain some measure of concurrency. It uses separate locks for partitions, so that multiple threads writing to the map are likely to access different partitions, using separate locks and therefore process their data simultaneously. This technique is known as lock-striping. Efficient striping uses a number of locks proportional to the number of CPU cores in a system. 5) The asynchronous processing model smooths resource spikes by adding requests to a queue which is serviced by a pool of workers - spikes in requests make the queue grow rather than overloading the workers. (The ExecutorService is essentially a thread pool accompanied by a task queue.) http://www.informit.com/articles/article.aspx?p=1994789 Discussion of using difference model for concurrency - http://highscalability.com[..]cks-application-architecture-pros-a.html Concurrency vs Parallelism - http://concurrencyfreaks.blogspot.hk[..]/2013/12/concurrency-vs-parallelism.html Compare between Actors, CSP, Disruptor and raw Threads - http://java-is-the-new-c.blogspot.com.au[..]omparision-of-different-concurrency.html Few coding tips that should be useful for most languages - http://www.javacodegeeks.com[..]erformance-scalability-and-liveness.html http://www.javacodegeeks.com[..]2015/09/java-concurrency-essentials.html Service Design Do one thing, do it well No shared operational state Bound your queues Name custom thread pools and register an UncaughtExceptionHandler Prefer immutable data objects over mutable state http://highscalability.com[..]-to-25-billion-notifications-during.html On Parallelism and Concurrency - https://inside.java/2021/11/30/on-parallelism-and-concurrency/ https://towardsdatascience.com[..]lism-what-is-the-difference-bdf01069b081 Solving Common Concurrency Problems - https://blog.professorbeekums.com[..]s.com/2021/solving-concurrency-problems/
(google search)
(amazon search)
|
Sat May 21 13:06:44 GMT 2022 From /weblog/design/examples
socialmedia
Open Sourcing Twitter’s Algorithm Part 1: How Twitter Works - https://transitivebullsh.it/oss-twitter-algorithm-part-1 https://www.infoq.cn/article/Es2BoMREB9JofbzQ2SBU
(google search) (amazon search)