RSS feed [root] /design /weblog




login:

password:

title search:




 


Thu Jan 25 22:38:50 GMT 2024

design



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

Sun Sep 20 14:10:28 GMT 2020 From /weblog/design

cache


5 Hints You're Using A Map When You Should Be Using a Cache? - http://dsoguy.blogspot.com[..]ints-your-using-map-when-you-should.html

How hibernate design the cache - http://www.javalobby.org/java/forums/t48846.html

Consider to do more careful update, not just update DB and dirty cache, but update DB and cache in a same time - http://dormando.livejournal.com/495593.html

Caching can be architectural smell, some hint and some alternative - http://www.codingthearchitecture.com[..]2/is_caching_an_architectural_smell.html

General caching discussion - http://tutorials.jenkov.com[..]are-architecture/caching-techniques.html http://www.infoq.com/cn/news/2017/01/Program-design-how-cache

http://highscalability.com[..]10-program-busting-caching-mistakes.html http://www.codeproject.com[..]B/web-cache/cachingmistakes.aspx?azid=74

缓存穿透?击穿?雪崩? - https://xie.infoq.cn/article/39495c2d568aca1d6db5c9c50?y=qun0918

(google search) (amazon search)


Fri Aug 21 13:54:46 GMT 2020 From /weblog/design

API design guideline


This is a message from a management blog, but I think the arguement is also apply API design. In fact, I think most critical difference of good and bad API is knowing which small detail is important and which is not - http://www.goodproductmanager.com[..]er.com/2007/11/08/sweat-the-small-stuff/

Design tips:
http://www.artima.com/weblogs/viewpost.jsp?thread=142428
http://openide.netbeans.org/tutorial/api-design.html
http://www.cincomsmalltalk.com[..]gView?showComments=true&entry=3258158706
http://today.java.net[..]its-of-highly-profitable-developers.html
http://www.infoq.com/news/2007/08/why-api-design-matters
http://www.infoq.com/presentations/effective-api-design
http://neuroning.com/2006/11/19/on-api-design-guidelines

About Compatibility issues
http://wiki.eclipse.org/Evolving_Java-based_APIs

A blog of using interfaces-vs-abstract-classes
http://hoskinator.blogspot.com[..]6/04/interfaces-vs-abstract-classes.html

XOM design overview - http://www.xom.nu/designprinciples.xhtml#d0e309

You need to identify the business value but not pick any tools/design just because it is cool - http://myarch.com/what-is-good-soa

A lot of links here - http://kasparov.skife.org/blog-live/src/api-design-refs.writeback http://discuss.joelonsoftware.com/default.asp?design.4.527465

An introduction of good OSS project to study their source - http://techkriti.wordpress.com[..]com/2007/06/28/learning-from-the-source/

CCCCDPIPE - http://blog.objectmentor.com/articles/2007/08/02/which-came-first

Discussion of why getting feedback quick is important - http://blog.objectmentor.com[..]u-dont-know-until-you-take-the-next-step

Someone saying that routines is the greatest invention in CS, I agree - http://www.codinghorror.com/blog/archives/001129.html

New way of modeling system then layering, The Onion Architecture - http://jeffreypalermo.com/blog/the-onion-architecture-part-1/

SOLID - http://www.lostechies.com[..]of-the-month-march-solid-principles.aspx http://dotnet.dzone.com/news/solid-software-works <-- very good picture! http://www.blackwasp.co.uk/SOLIDPrinciples.aspx https://www.freecodecamp.org[..]d-principles-explained-in-plain-english/

Idempotent, Orthogonality, Immutability - http://www.codinghorror.com/blog/archives/001244.html

Some example of how to driven good API - http://jdegoes.squarespace.com[..]al/2009/5/11/good-api-design-part-3.html

It's not enough to write tests for an API you develop, you have to write unit tests for code that uses your API. When you do, you learn first-hand the hurdles that your users will have to overcome when they try to test their code independently. http://butunclebob.com[..]MichaelFeathers.TheGoldenRuleOfApiDesign

Active interface vs. Passive interface, for me this is another way to under "Tell, don't ask" - http://code-o-matic.blogspot.com[..]-on-api-design-call-stack-as-source.html

The Principles of Good Programming - http://www.artima.com/weblogs/viewpost.jsp?thread=331531

http://net.tutsplus.com[..]software-principles-you-must-understand/

Difference choice of how API evolute with change - http://blog.jooq.org[..]sive-api-evolution-with-java-interfaces/

JUnit's evolving structure. - http://edmundkirwan.com/general/junit.html

API performance contract - http://queue.acm.org/detail.cfm?ref=rss&id=2576968

Consistent naming conventions
Standard terminology
Uniform error responses
Attention to detail (that’s the love part for APIs)
REST APIs that work with only 2 resources and use 4 HTTP verbs (oh, there is so much more to talk about here…)
Avoid API design by way of method-driven approach – that leads you down a slippery slope
- See more at: http://blogs.ancestry.com[..]are-like-parenting/#sthash.Ux1LHMNU.dpuf

http://blog.jooq.org[..]ake-this-mistake-when-developing-an-spi/

Guideline for webapi - https://cloud.google.com/apis/design/

Good naming is part of design. It sets expectations and communicates a model, showing how something should be understood and used. If you mean to tell the reader getMillisSince1970, don’t say getTime. Specific names inspire you to consider alternatives, to question whether you’re capturing the right abstraction in the right way. It’s not just labeling and it’s not just java.util.Date: This is about the code you write and the code you use. - https://medium.com/97-things/name-the-date-c82bafdc4c44

(google search) (amazon search)


Fri Jul 24 13:50:06 GMT 2020 From /weblog/design/examples

mailinator


https://manybrain.github.io/m8r_blog/blog/mailinator-evolution/

(google search) (amazon search)


Sat May 23 04:22:23 GMT 2020 From /weblog/design

refactoring


http://c2.com/cgi/wiki?RefactoringLanguage

Refactoring to Patterns Catalog - http://www.industriallogic.com/xp/refactoring/catalog.html

Article talk about the book: http://www.oreillynet.com/ruby/blog/2006/03/transformation.html

Catagories smell into "smell in class" and "smell between class" - http://www.codinghorror.com/blog/archives/000589.html

Known but good to remind http://www.thecodejunkie.com[..]10/01/6-steps-to-master-refactoring.html

An experience sharing - http://www.javacodegeeks.com[..]m/2011/05/refactor-hudson-god-class.html http://www.peterprovost.org[..]treme-Refactoring-with-Brian-Button.aspx

Refactoring should not introduce bug... - http://jchyip.blogspot.com[..]01/so-why-are-you-refactoring-again.html

A way to have formal refactoring, through Feature Clustering, Rapid Scratch Refactoring and Twisting Classes - http://www.thekua.com[..]rom-michael-feathers-brutal-refactoring/

Not all code change is refactoring - http://parlezuml.com/blog/?postid=850 , and

Some common issues about refactoring code in a team - http://www.rickylui.com[..]/2008/01/28/dont-be-a-refactoring-bigot/ http://blog.joepoon.com[..]01/dangers-of-premature-refactoring.html , beware taking the balance - http://www.makinggoodsoftware.com[..]ith-beautiful-code-the-refactor-syndrome

Refactory if needed - http://dreamhead.blogbus.com/logs/24874404.html

Refactoring, when start, when stop? - http://martinfowler.com/bliki/OpportunisticRefactoring.html

Refactoring metric - http://www.grahambrooks.com[..]rics-based-refactoring-for-cleaner-code/

Getting rid of util class
1) If the family of methods uses different parameters, depending on optional input or representations of the same input, then consider transforming the Helper via a fluent interface using the Builder pattern: from a collection of static methods like Helper.calculate(x), calculate(x, y), calculate(x, z), calculate(y, z) we could easily get to something like newBuilder().with(x).with(y).calculate(). The helper class would then offer behaviours, reduce its list of business methods and provide more flexibility for future extensions. Callers would then use it as internal field for reuse or instantiate it where needed. The helper class (as we knew it) disappeared.
2) If the helper class provides methods which are actually actions for different inputs (but, at this point, for the same domain), consider applying the Command pattern: the caller will actually create the required command (which will handle the necessary input and offer a behaviour) and an invoker will execute it within a certain context. You may get a command implementation for each static method and your code would move from an Helper.calculate(x, y), calculate(z) to something like invoker.calculate(new Action(x, y)). Bye bye helper class.
3) If the helper class provides methods for the same input but different logics, consider applying the Strategy pattern: each static method may easily become a strategy implementation, vanishing the need of its original helper class (replaced by a context component then).
4) If the given set of static methods concerns a certain class hierarchy or a defined collection of components, then consider applying the Visitor pattern: you may get several visitor implementations providing different visit methods which would probably replace partially or entirely the previously existing static methods.
5) If none of the above cases met your criteria, then apply the three most important indicators: your experience, your competences in the given project and common sense.

http://www.refactoringideas.com[..]-to-get-rid-of-helper-and-utils-classes/

Converting forloop to streaming - http://martinfowler.com/articles/refactoring-pipelines.html

Refactoring JavaScript from Sync to Async in Safe Baby-Steps - http://www.natpryce.com/articles/000812.html

code-refactoring-dos-donts - https://jaxenter.com/code-refactoring-dos-donts-135960.html

Let clean code guide you. Then let it go. - https://overreacted.io/goodbye-clean-code/ https://www.infoq.cn/article/dNO484YEeumvC6b6ZNWL

https://martinfowler.com/articles/class-too-large.html

(google search) (amazon search)


Sat May 16 17:10:13 GMT 2020 From /weblog/design/examples

zoom


http://highscalability.com[..]2020/5/14/a-short-on-how-zoom-works.html

(google search) (amazon search)


Thu May 07 12:31:36 GMT 2020 From /weblog/design/distribute

event


Event Bus Implementation(s) - https://hackernoon.com/event-bus-implementation-s-d2854a9fafd5 http://www.infoq.com[..]2017/08/Summary-event-bus-implementation

http://jakewharton.com/managing-the-reactive-world-with-rxjava/

6 Event-Driven Architecture Patterns — https://medium.com[..]rchitecture-patterns-part-1-93758b253f47

(google search) (amazon search)


Sat Mar 28 12:09:46 GMT 2020 From /weblog/design/distribute

scalability


There are two key primary ways of scaling web applications which is in practice today.
1) “Vertical Scalability” - Adding resource within the same logical unit to increase capacity. An example of this would be to add CPUs to an existing server, or expanding storage by adding hard drive on an existing RAID/SAN storage.
2) “Horizontal Scalability” - Adding multiple logical units of resources and making them work as a single unit. Most clustering solutions, distributed file systems, load-balancers help you with horizontal scalability.

Scalability can be further sub-classified based on the “scalability factor”.
1) If the scalability factor stays constant as you scale. This is called “linear scalability“.
2) But chances are that some components may not scale as well as others. A scalability factor below 1.0 is called “sub-linear scalability“.
3) Though rare, its possible to get better performance (scalability factor) just by adding more components (i/o across multiple disk spindles in a RAID gets better with more spindles). This is called “supra-linear scalability“.
4) If the application is not designed for scalability, its possible that things can actually get worse as it scales. This is called “negative scalability“.

http://www.royans.net/arch/2007/09/22/what-is-scalability/

Report of building web application with 55k pageload with rail - http://shanti.railsblog.com[..]mongrels-handled-a-550k-pageview-digging

XMPP a IM protocol about scalability - http://www.process-one.net[..]icle/the_aol_xmpp_scalability_challenge/

Presentation and resources of making you website more scalable - http://www.scribd.com[..]9/Real-World-Web-Performance-Scalability http://www.theserverside.com[..]lications&asrc=EM_NLN_3990118&uid=703565 http://www.theserverside.com[..]ionsPart2&asrc=EM_NLN_3990119&uid=703565

Brian Zimmer, architect at travel startup Yapta, highlights some worst practices jeopardizing the growth and scalability of a system:
* The Golden Hammer. Forcing a particular technology to work in ways it was not intended is sometimes counter-productive. Using a database to store key-value pairs is one example. Another example is using threads to program for concurrency.
* Resource Abuse. Manage the availability of shared resources because when they fail, by definition, their failure is experienced pervasively rather than in isolation. For example, connection management to the database through a thread pool.
* Big Ball of Mud. Failure to manage dependencies inhibits agility and scalability.
* Everything or Something. In both code and application dependency management, the worst practice is not understanding the relationships and formulating a model to facilitate their management. Failure to enforce diligent control is a contributing scalability inhibiter.
* Forgetting to check the time. To properly scale a system it is imperative to manage the time alloted for requests to be handled.
* Hero Pattern. One popular solution to the operation issue is a Hero who can and often will manage the bulk of the operational needs. For a large system of many components this approach does not scale, yet it is one of the most frequently-deployed solutions.
* Not automating. A system too dependent on human intervention, frequently the result of having a Hero, is dangerously exposed to issues of reproducibility and hit-by-a-bus syndrome.
* Monitoring. Monitoring, like testing, is often one of the first items sacrificed when time is tight.

http://highscalability.com/scalability-worst-practices

Useful Corporate Blogs that Talk About Scalability - http://highscalability.com[..]l-corporate-blogs-talk-about-scalability

Overview of mapreduce and how it compare with other distributed programming model -http://natishalom.typepad.com[..]0/is-mapreduce-going-to-main-stream.html

Paper of data store at amazon http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html

Discuss how haven't sync can cause performance issue - http://www.theserverside.com[..]lications&asrc=EM_NLN_6273194&uid=703565 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6423457

Discussion about Cloud Based Memory Architectures - http://highscalability.com[..]ased-memory-architectures-next-big-thing

http://highscalability.com[..]alability-and-performance-best-practices

Interview with google engineer - http://www.zdnet.co.uk[..]gle-at-scale-everything-breaks-40093061/

Surprisingly youtube is blocking - http://highscalability.com[..]e-scalability-lessons-in-30-minutes.html

If we are seeing a sustained arrival rate of requests, greater than our system is capable of processing, then something has to give. Having the entire system degrade is not the ideal service we want to give our customers. A better approach would be to process transactions at our systems maximum possible throughput rate, while maintaining a good response time, and rejecting requests above this arrival rate. - http://mechanical-sympathy.blogspot.com.au[..]apply-back-pressure-when-overloaded.html

How twitter scaling - http://www.infoq.com/presentations/Twitter-Analytics

How Reddit scaling - http://www.infoq.com/presentations/scaling-reddit

How Hotjar scaling - https://www.hotjar.com[..]-while-scaling-hotjars-tech-architecture

How infiniteDB prevent locking and IO - http://highscalability.com[..]-scalable-relational-database-manag.html

http://highscalability.com[..]ard-way-about-scaling-a-million-use.html http://martin.kleppmann.com[..]2014/03/26/six-things-about-scaling.html

The experiences of various big companies, about network issues - http://aphyr.com/posts/288-the-network-is-reliable

Stackoverflow, scale without cloud - http://highscalability.com[..]nth-25-servers-and-i.html?SSLoginOk=true

How netflix scale - http://highscalability.com[..]ix-what-happens-when-you-press-play.html

Scaling to 100k Users - https://alexpareto.com[..]ity/systems/2020/02/03/scaling-100k.html https://www.infoq.cn/article/Tyx5HwaD9OKNX4xzFaFo

(google search) (amazon search)


Sun Mar 15 23:47:36 GMT 2020 From /weblog/design

Object attributes


About getter and setter - http://blog.milesbarr.com/2006/09/getters-and-setters/

Discussion of hashcode and equal of collections - http://redsolo.blogspot.com[..]11/why-no-equals-and-gethashcode-in.html

A blog discuss the problem of getter / setter - http://jroller.com[..]rise?entry=the_case_against_the_property

Equality Is Hard - https://www.craigstuntz.com[..]m/posts/2020-03-09-equality-is-hard.html

(google search) (amazon search)


Wed Mar 04 00:23:59 GMT 2020 From /weblog/design

functional


Having functional program in java? http://codemonkeyism.com/functional-programming/

Functional programming in old java, with eclipse template - http://www.javacodegeeks.com[..]functional-programming-with-map-and.html

Functional Programming For The Rest of Us - http://www.defmacro.org/ramblings/fp.html?

collection-pipeline - http://martinfowler.com/articles/collection-pipeline/

Make code composable - https://hackernoon.com[..]ical-functional-programming-6d7932abc58b

A primer on functional architecture - https://increment.com[..]cture/primer-on-functional-architecture/

(google search) (amazon search)


Sat Nov 16 12:30:12 GMT 2019 From /weblog/design/examples

web


https://codurance.com[..]ites-using-finite-state-machines-part-I/

(google search) (amazon search)


Fri Sep 06 12:54:59 GMT 2019 From /weblog/design/examples

Serialization


What serialization is bad - http://cr.openjdk.java.net/~briangoetz/amber/serialization.html

(google search) (amazon search)



Thu May 23 14:45:47 GMT 2019 From /weblog/design

camera


軟體相機時代來臨!Google Pixel 工程師來台揭秘相機技術 - https://www.inside.com.tw[..]cle/16465-google-pixel-camera-background

(google search) (amazon search)


Wed Feb 20 03:22:20 GMT 2019 From /weblog/design/distribute

performance


Basically, cache as much as you can, limit the bandwidth as much as you can - http://horicky.blogspot.com[..]2009/08/skinny-straw-in-cloud-shake.html

http://www.edwardcapriolo.com[..]ry/cassandra_compression_is_like_getting

Compression usually very useful - http://abdullin.com[..]observations-on-big-data-for-retail.html

Discussion of design of Aeron, a new messaging system - http://highscalability.com[..]eally-need-another-messaging-system.html

How BBG use Hadoop, and tune it - http://highscalability.com[..]2/17/the-big-problem-is-medium-data.html

Benefits of single-threaded design - https://epickrram.blogspot.com/2019/02/recall-design.html

(google search) (amazon search)


Mon Jan 21 14:35:44 GMT 2019 From /weblog/design/pattern

active


https://codurance.com/2019/01/14/active-pattern/

(google search) (amazon search)


Sat Nov 24 14:52:19 GMT 2018 From /weblog/design

wechat


https://blog.acolyer.org[..]ontrol-for-scaling-wechat-microservices/

http://www.10tiao.com/html/554/201811/2654694647/1.html

(google search) (amazon search)


Sat Nov 10 16:56:20 GMT 2018 From /weblog/design/exception

Why use exception instead of error code


A detailed explanation - http://gamearchitect.net/Articles/ExceptionsAndErrorCodes.html

What are exceptions? - https://binkley.blogspot.com/2018/11/what-are-exceptions.html

(google search) (amazon search)


Sat Feb 24 15:42:46 GMT 2018 From /weblog/design/interview

facebook


Do the simple thing first.
Do fewer things better.
Upfront work but can pay huge dividends.
Don’t reinvent the wheel.
Nothing lasts forever.

http://highscalability.com[..]-from-5-years-of-building-instagram.html

https://www.infoq.com/interviews/adams-php-facebook

(google search) (amazon search)


Fri Feb 02 02:19:00 GMT 2018 From /weblog/design/interview

wechat


http://www.infoq.com/cn/articles/wechat-video-call

(google search) (amazon search)


Thu Nov 16 01:55:26 GMT 2017 From /weblog/design

static


I will prefer using static method as less as possible... there is some
side effect you are not expected, like, are you sure it thread safe? static
method easier to have thread problem.

You may take a look at http://debasishg.blogspot.com[..]007/03/making-classes-unit-testable.html , http://www.beust.com/weblog/archives/000173.html and http://discuss.joelonsoftware.com[..]Parent=7972&ixDiscussGroup=3&cReplies=29

Parameter passing vs static accessor: Should I press things around or get from public static instance? - http://groups.yahoo.com/group/refactoring/message/3342

Reason of static method is not overrided - http://groups.google.com[..]thread/ec8b924d60dd4734/99b488aa1f8106c9

Another example of thread problem with static member - http://jroller.com[..]=calendar_dateformat_and_multi_threading

How to mock static method code for testing - http://blog.xebia.com/2007/06/21/mocking-static-calls/

http://googletesting.blogspot.com[..]ic-methods-are-death-to-testability.html

Factory is bad? - http://www.yegor256.com/2017/11/14/static-factory-methods.html

(google search) (amazon search)


Sun Oct 01 08:19:43 GMT 2017 From /weblog/design

comment


A nice thread of discussing how to comment in code - http://groups.yahoo.com/group/extremeprogramming/message/74195

A Taxonomy Of Comments - http://blog.codefx.org[..]hniques/documentation/taxonomy-comments/

Everything have 2 sides - http://blog.codefx.org[..]s/documentation/comments-costs-benefits/

Example of comment haven't update freq enough - http://marxsoftware.blogspot.hk[..]even-good-code-comments-deteriorate.html

https://testing.googleblog.com[..]health-to-comment-or-not-to-comment.html

Putting comments in code: the good, the bad, and the ugly. - https://medium.freecodecamp.org[..]e-good-the-bad-and-the-ugly-be9cc65fbf83

(google search) (amazon search)


Tue Aug 29 02:34:21 GMT 2017 From /weblog/design

documentation


Comment about the java document of jdk8 - http://marxsoftware.blogspot.com.au[..]14/03/illuminating-javadoc-of-jdk-8.html

Thoughts On Comments - http://blog.codefx.org[..]ques/documentation/thoughts-on-comments/

The Art of Crafting Architectural Diagrams - https://www.infoq.com/articles/crafting-architectural-diagrams http://www.infoq.com/cn/articles/crafting-architectural-diagrams

(google search) (amazon search)


Wed Aug 09 03:37:20 GMT 2017 From /weblog/design

null


Use present and absent rather than NULL - http://binkley.blogspot.com/2012/01/better-than-null.html

Propose of enhancement, null handelers and null reference - http://shemnon.com[..]01/null-handelers-and-null-refere-1.html

How null breaks polymorphism - http://eureka3d.com[..]s-polymorphism-or-the-problem-with-null/ http://eureka3d.com[..]orphism-or-the-problem-with-null-part-2/

Discussion about forbid NULL as parameter and return - http://javablog.co.uk[..]5/07/null-parameters-and-returning-null/

Default object in C# - http://www.kodefuguru.com[..]t/2012/09/25/Default-Objects-with-C.aspx

Discussion about using optional - http://blog.jooq.org/2015/08/20/divided-we-stand-optional/

Some suggest about do something better than use null - https://blog.jetbrains.com/idea/2017/08/code-smells-null

(google search) (amazon search)


Wed Jul 19 06:59:51 GMT 2017 From /weblog/design

packaging


Avoid circular dependencies between packages! http://www.infoq.com/news/2007/06/large-code-bases

2 common approach, by function or by layer - http://dolszewski.com/architecture/project-package-organization/

(google search) (amazon search)


Thu Mar 09 15:13:09 GMT 2017 From /weblog/design

visibility


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)