AOP aims at reducing the amount of "tangled" code by which we mean code that might be implemented in different classes if a OOP language is used but still share important secondary requirements. Such requirements are said to cross-cut the system's basic functionality and are difficult to develop and maintain using non-AOP programming paradigms. Cross-cutting functionality can be thought of as functionalty spanning many objects.

Logging is the prototypical example of a cross-cutting concern. E.g. an application might use logging in multiple classes when methods are entered or exited. So even though the classes themselves have different responsibilities and are implemented differently they still perform the same secondary functionality, in this case, logging.

To sum up: The goal of AOP is to support the programmer in cleanly separating compontents and the cross-cutting concerns of these, in AOP-lingo called aspects, from each other. This is achieved by promoting the cross-cutting concerns to first-class program modules.

The goal of AOP is in contrast with OOP and POP in that those paradigms only separate components from each other. 

Dependency Inversion

The Dependency Inversion Principle states that:

  1. High level modules should not depend upon low level modules. Both should depend upon abstractions.
  2. Abstractions should not depend upon details. Details should depend upon abstractions.

The Dependency Inversion principle (DIP) helps us to develop loosely couple code by ensuring that high-level modules depend on abstractions rather than concrete implementations of lower-level modules. The Inversion of Control pattern is an implementation of this principle. 

The design patterns are strategies for solving common object-oriented design problems. Using the design patterns you can make your code more flexible, reusable and maintainable. We must use the design patterns during the analysis and requirement phase of SDLC (Software Development Life Cycle).

A design pattern is a general reusable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.

Basically, design patterns are categorized into two parts:

  1. Core java (or JSE) Design Patterns.
  2. JEE Design Patterns.

At a higher level there are architectural patterns that are larger in scope, usually describing an overall pattern followed by an entire system.

Regular expressions are used for defining String patterns that can be used for searching, manipulating and editing a text. These expressions are also known as Regex (short form of Regular expressions).

Twelve characters have special meanings in regular expressions: the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening parenthesis (, the closing parenthesis ), the opening square bracket [, and the opening curly brace {. These special characters are often called "metacharacters". If you want to use any of these characters as a literal in a regex, you need to escape them with a backslash.

When we start two or more threads within a program, there may be a situation when multiple threads try to access the same resource and finally they can produce unforeseen result due to concurrency issue. For example if multiple threads try to write within a same file then they may corrupt the data because one of the threads can overrite data or while one thread is opening the same file at the same time another thread might be closing the same file. The problems arise when multiple threads access the same resources - the same memory (variables, arrays, or objects), systems (databases, web services etc.) or files. To prevent race conditions from occurring you must make sure that the critical section is executed as an atomic instruction. That means that once a single thread is executing it, no other threads can execute it until the first thread has left the critical section. Synchronization in Java will only be needed if shared object is mutable.

Set Interface

A set is an Interface that provides an un-ordered collection of unique objects (does not contain duplicate values). In provides three general purpose implementations in Java.

1) HashSet

HashSet stores its elements in a HashTable and does not guarantee of any type of ordering in iteration.

2) TreeSet

TreeSet orders its elements on the basis of their values.

3) LinkedHashSet

It orders its elements on the basis of order in which they were inserted in the set.

List Interface

A List is an ordered and indexed collection that can contain duplicate values. List allows null elements. It provides three general purpose implementations.

1) ArrayList

ArrayList is more general purpose and provides random access with index. ArrayList is an expendable array of values or objects. If you need to access elements frequently by using index, ArrayList provides faster access if you know index. ArrayList represents an automatic re-sizeable array and used in place of array.

2) LinkedList

LinkedList is more suitable for frequently adding and removing elements from List. LinkedList also implements Deque interface, which provides first in first out operations.

3) Vector

Vector is synchronized and thread safe in nature.

Map Interface

A Map interface provides key-value pairs. Maps can not contain duplicate keys and one key can be mapped to atmost one element. In Java Map interface provides three general purpose implementations.

1) HashMap

2) TreeMap

3) LinkedHashMap

1) HashMap

HashMap does not guarantee that the order of the objects will remain the same over the time.