Item 20: Prefer interfaces to abstract classes

Advantages Existing classes can easily be reconstructed to implement a new interface. You just need to use implements clause to the class declaration and add the required methods Interfaces are ideal for defining mixins (Example: http://hannesdorfmann.com/android/java-mixins) Interfaces allow for the construction of non-hierarchical type frameworks. They are great for organizing things that don’t fall into a hierarchy

Read More

Item 15: Minimize the accessibility of classes and members

Encapsulation A well-designed component hides all its implementation details, cleanly separating its API from its implementation. Components then communicate only through their APIs and are oblivious to each others’ inner workings. This concept, known as information hiding or encapsulation, is a fundamental tenet of software design. The advantages of encapsulation are as follows: Speeds up

Read More

Spring: Big Picture

What is Spring? Spring makes it easy to create Java enterprise applications.It is a complimentary to Java EE. Spring is open source. It has a large and active community. Spring 5.0 requires JDK 8+ and provides out-of-the-box support for JDK 9. Fundation: Spring Framework The Spring Framework is an application framework and inversion of control container for the Java

Read More

Terraform: Import AWS resources

Problem: Resource already exists If there are some AWS resources that are not exist in terraform scripts and you run terraform apply, you might get “XXXX already exists” errors. I listed some of them: BucketAlreadyExists: The requested bucket name is not available EntityAlreadyExists: A policy called dummy-policy-name already exists. Duplicate names are not allowed ResourceInUseException: Table already exists: dummy-table-name

Read More