When writing software, it is important to keep you organized and focused, losing focus or vague understanding requirements will endup in a bad written system in the best case. If you have got a large body of work that needs to go into production there are lots potential things that can go wrong. When you […]
S3Fuse Java
S3Fuse allows you to mount an S3 bucket to your local storage and interact with it like it was stored into your local storage. It is written in Java and it will be published to my github account soon. It allows to read data from S3 but it is not possible yet to write data […]
Hashing performance problem and how it was solved
Recently I run into a problem where hashing some data had a big impact on the application performance. There are few factors that influenced this but it required 2.5x more instances, imagine when you have 15 instances of you application in production and it requires 38 to serve the same traffic. In order to understand […]
Indexes – Choosing a good column order
The purpose of this article is to explain (mainly to myself) a technique for creating good indexes for mysql database. Before starting I would like to discuss about selectivity. Index selectivity is the ratio of number of distinct indexed values ( the cardinality) over the total numbers of rows in the table (#T), and ranges […]
Martin Fowler @ OOP2014 „Not Just Code Monkeys”
Martin Fowler @ OOP2014 „Workflows of Refactoring”
Over the last decade or so, Refactoring has become a widely used technique to keep a high internal quality for a codebase. However most teams don’t make enough use of refactoring because they aren’t aware of the various workflows in which you can use it. In this keynote talk from OOP 2014 in Munich, Martin […]
Favor composition over inheritance
Inheritance is a powerful way to achieve code reuse, but it is not always the best tool for the job. Used inappropriately, it leads to fragile software. Unlike method invocation, inheritance violates encapsulation. In other words, a subclass depends on the implementation details of its superclass for its proper function. A class B should extend […]
Minimize mutability
An immutable class is a simply class whose instances cannot be modified. All of the information contained in each instance is provided when it is created and is fixed for the lifetime of the object. Don’t provide any methods that modify the object’s state (known as mutators) Ensure that the class can’t be extended. This […]
In public classes, use accessor methods, not public-fields
Occasionally, you may be tempted to write degenerate classes that server no purpose other than to group instance fields: //Degenerate classes like this should not be public! class Point { public long x; public long y; } Because the data fields of such classes are accessed directly, these classes do not offer the benefits of […]
Minimize the accessibility of classes and members
The single most important factor that distinguishes a well-designed module a poorly designed one is the degree to which the modules hides its internal dara and implementation details. A well-designed module hides all of its implementation details, cleanly separating its API from its implementation. Information hiding doesn’t cause on itself good performance, it enables effective […]