Glossary

Version 5.6 by chrisby on 2023/02/11 09:36

An object is injected with the dependencies it needs, rather than constructing them itself.The explanations given here do not claim to be complete. They merely serve as a brief description to give an idea of the respective term. For more detailed information, the Internet should be consulted. Note that some of these technical terms are fuzzy, overlap with other terms, or have different meanings depending on the context or the people using them. This Glossary is an attempt to structure these terms in a concise manner. Be open to variations as you talk and work with other developers.

TermExplanation
Abstraction
  1. The opposite of "Concretion". It refers to interfaces and abstract classes that define behavior, namely function signatures, but contain no information about the internal operation of the functions.
  2. A generic, high-level unit. For example, a class may have two functions that contain duplicate code, which the DRY principle says should not happen. The duplication can be resolved by moving the duplicate code to a common function (the "abstraction" of that code) and calling the function where the code was previously located. The duplicated code has been "abstracted".
AssertionRefers to an assertion function which is an essential part of test code. If the input values do not satisfy a particular condition, the test containing the assertion will fail. Example call: "assertEquals(expectedResult, actualResult)".
Aware/UnawareClass A contains a source code reference to class B and is therefore aware of class B. If you only read the source code of class A, you would know that there must be a class B. If there was no such reference, class A would be unaware of class B.
Best PracticesGenerally accepted guidelines for increasing your programming productivity. Taking them seriously will save you a lot of pain.
Concretion

It is the counterpart to "abstraction" and is sometimes called "implementation". In OOP it refers to non-abstract classes that could implement methods of interfaces or abstract classes. A concretion defines the internal workings of these abstract functions by providing the "concrete" code.

Constructor InjectionDependency injection, which is performed by passing a dependency to an instance via a constructor argument.
Component
  1. In Spring, this is a generic annotation for a bean that does not match any other Spring bean annotation: "@Component".
  2. In software architecture, it is a module that can be executed independently. It is often compiled and/or compressed into an executable such as a .jar or .exe file.
Data StructureA very simple type of class that contains only data and no logic. For example, a class that has only public fields and no methods. Another form is a class with private fields and simple corresponding getters and setters.
DependencyIn the context of classes, a dependency is a member field of one class that must be initialized with an instance of another class in order for an instance of the first class to function properly. This initialization is often done by dependency injection.
Dependency CycleFor example, an instance of one class requires an instance of another class to be constructed, and vice versa. So both classes need the other dependency to construct an instance. Therefore, it is impossible to construct either instance at all. Always make sure that the dependency graph looks like a directed acyclic graph.
Dependency Injection (DI)A technique in which the dependencies an object needs are injected from the outside, rather than constructed within the class.
Dirty

1. Messy, unreadable, or poorly designed code is referred to as "dirty code". Often associated with code written "quick-and-dirty" due to the time constraints of a software project.2. The term comes from the phrase "getting one's hands dirty" and refers to coding work that is considered monotonous, detailed, low-level, or undemanding, but necessary. The term is often used in the context of I/O operations. For example, creating a database transaction, is often done in a similar way and is not considered fun by experienced programmers who have done it many times. High-level design is more exciting because it requires more creativity from the developer and is more intellectually stimulating.

Dynamic

Often refers to processes that appear at run time when the code has already been executed and is "running". Examples:

  • Dynamic dependencies are dependencies that can be replaced at runtime.
  • Dynamically typed languages determine the type of an object at runtime.
Entity

1. In an object context, this means that two objects of the same type that contain exactly the same values in their fields can be considered equivalent, but are still two separate entities.

2. In the context of software architecture, the term refers to classes that represent the data model of the application. For example, a banking application may have entity classes such as account, order, customer, or employee. They are often built like simple data structures, but may contain additional validation logic to impose logical constraints on their fields. For example, the integer field customer.age must always be between 0 and 120 because this is a logical constraint on the age of people, even though the integer data range is technically much larger.

Field InjectionA type of dependency injection that is performed by forcibly injecting a dependency into an instance through the use of reflections that break even the encapsulation of private fields. This type of dependency injection should be avoided.
Inversion of Control (IoC)Shifts the responsibility for defining the logic and order of dependency injections from the developer to the computer.
JavaBean

A design convention for data structures. Usually it means a class that has

  • a public no-argument constructor
  • only private fields
  • only getters and setters for each field as methods

Often DTOs and entities follow this convention.

LogicAny code with non-trivial complexity can be called "logic". In contrast, for example, getters and setters have trivial complexity.
Magic"Code that handles complex tasks while hiding that complexity to present a simple interface."[sources] For example, the introduction of an IoC container is often quite simple, but the logic and wiring that goes on in the background is complex.
PainSomething causes pain when someone spends unnecessary effort on a task that could often have been avoided by better code design.
Production CodeThe counterpart to the Test Code. It contains all the code needed to run the application.
Runtime

The period of time during which the code is executed. For example:

  • An exception is thrown by the compiler that finds invalid syntax in the source code. This is called a compile-time exception.
  • Suppose that after a successful compilation, an executable file was created, started, and an exception was thrown shortly thereafter. Since this happened at runtime, it is a runtime exception.
Separation of ConcernsA principle that says that software should be structured modular, with each module dealing with a different aspect of the program. This is intended to give the software a clear, understandable architecture.
Setter InjectionA type of dependency injection, which is performed by passing a dependency to an instance via a setter method argument.
Spring Bean

A term used in the Spring Framework for an object that is contained in the IoC container to be injected into other beans and/or to receive dependency injections. It is one of many components/beans that are wired together via IoC to form the application when it is started.

It should not be confused with JavaBeans.

Static

Often refers to processes that depend on non-running code. Examples:

  • Static code analysis tools can examine source code files for possible improvements.
  • Statically typed languages determine the type of an object at compile time.
Test CodeThe counterpart to the Production Code. It is code that checks that the production code works as expected. Test code has no role in the operation of an application.
Test-Driven DevelopmentA workflow in which the developer implements code in small steps, incrementally and iteratively, defining tests at each iteration.
WiringThe process of generating and injecting dependencies to start an application, performed by the IoC container.