This section describes all the important terminology used throughout the book.  If you are not experienced java developer, please read this section in detail before the rest of the book.  If you do not know most of these terms, proceed no further; go back and do the Java Tutorial by Oracle.

Terminology

Description

API

Application Programming Interface.  This can mean a Java Interface class, web service or even a micro service.   Anything that provides access to execute some code.

bean

A Java bean.  This is typically a java class with public getters and setters for every attribute.  For example, a Person class could be a bean, with public getSurname() and setSurname(..) methods.  There is a bean standard that can be followed for beans.

blocking

Where a block of code is restricted for execution by just one thread at a time (such as in a synchronized method), other threads will wait and do nothing until they have exclusive access to the block.  This act of doing nothing is called blocking.  Blocking can also occur on a thread when it is waiting for I/O, such as waiting for the operating system to open a file for it.  The term can also be used to describe waiting for a response from a database query or transaction over a network, where the thread does no other processing while it waits.  A web server may have a limit of 50 requests being processed at any moment, yet can accept 200 requests.  The other 150 requests will be put in a queue and block until the webserver is ready.

block of code

{ ... } This is normally code contained within a set of curly braces.  A block can be:

  • a method

  • what happens when an if condition is true

  • commands within the try { .. } brackets

  • commands within the catch { } brackets

  • any code arbitrarily placed within curly braces.

All variables defined within the block have scope just within that block.

browser

A Web Browser such as Mozilla Firefox, Chrome, Safari, but also mean browsers on cell phones.

camel case

Camel case is where every word (other than the first word) starts with a capital letter.  thisIsAnExample.  It is commonly used for variable naming in Java.

class

Java Class, provided by Java or written by the developer.

code-bloat

Where software contains many lines of unused, duplicated, or unneccessary code.  It can also mean a piece of software that is much larger than it needs to be to perform its function.

codebase

A generic term used to describe the full body of source code used to build the application, including screens, build scripts and sometimes even libraries and tools required to compile it. The codebase is usually checked into some a source code repository so that repeatable builds and automation are possible.  Developers work on the codebase to complete the project.  The codebase is not “the project”, since projects also consist of documentation, management, testing, environments, deployments, changes to business processes etc.

constant

Variable that can be defined in one place and referenced because it is unlikely to change often.  Typically represented as public static final variables, named in UPPER_CASE_SEPARATED_BY_UNDERSCORES.

context

Similar to scope, context is an “area of relevance” that means it has little meaning outside its defined boundaries.  It can best be imagined by considering about the opposite - what happens when words are taken out of context. In programming, the word “Context” is often used where the word “Information” will do, but it usually means “Information related to a specific area”.

controller

Part of the Model View Controller (MVC) design pattern for GUI applications.  The controller is the glue that works out what to do with user requests, deciding which page to navigate to next, and hooks up views with the model data.  See the [pattern.mvc] section in this book

DAO

Data Access Object. Application data is referenced through an abstraction layer that gives no indication of the data source, either from a database or API call.  This layer is easily replaced with a different implementation at a future time.

environment

A logical name given to a server environment. Some examples:

  • Development

  • SIT (Systems Integration Testing)

  • UAT (User Acceptance Testing)

  • Staging (or Pre-production)

  • Production

extend

Also called subclassing in object oriented language.  By extending a class, you create a new kind with the same behavior but with added features.

public class Employee extends Person

IDE

Integrated Development Environment.  A user interface that dramatically speeds up development.  Two open source examples for Java are Eclipse and NetBeans.

implementation

Normally this means; a class that provides all the methods required by an interface, but it can also mean some code that provides all the functionality and structure defined required by a design pattern.  In Java you have an interface and implementations of that interface.

instance

A physical, usable version of a class.  There is only ever one class definition, but there can be millions of instances of it created in memory.

For example, you can create a pottery mold (the class), but it has no value unless you create an instance of a pot using the mold.

An instance means a working creation made from a class definition.  In the following code, “myInvoice” is an instance of the Invoice class.

Invoice myInvoice = lookupInvoice(invoiceNumber);

interface

This concept is fundamental to Java.  Where used in this book it means a “Java interface” rather than an Application Programming Interface (API).

Java array

A native Java language array, such as byte[], as opposed to a collection.

JVM

Java Virtual Machine.  If you have not heard of this one go back and have a play with Java first.

local variable

A variable defined within a set of curly braces {..}, to be used only within those curly braces.  As long as the reference is not assigned to another variable, most local variables are available for garbage collection when the closing curly bracket is reached.

member variable

A variable defined in class scope at the top of a class.  Member variables are usually private and access is controlled through public methods.

method

Otherwise known as a function, but a method is within the scope of a class.  For example, an Invoice class might have a getTotal() method on it.

method signature

The name and parameters that a caller needs to provide for calling a method, plus its other attributes like what it returns, what exceptions it throws, whether it is private or public, static or non static.  For example, the method signature for a file copying method might be:



public int copyFile(File from, File to)

       throws IOException;

It is subtly different from the method signature of this method:

public static int copyFile(File filename, File to)

       throws IOException;

modifier

Modifies the visibility of a method or a variable.  eg. public/private/static

model

Part of the Model View Controller (MVC) design pattern for user interface construction.  The model contains all of the reusable business logic for the application, the database, connections to other integration systems.

multi-threaded

Multiple program flows executing in parallel.   Normally a CPU with multiple cores is required to allow multiple threads to operate at once effectively but it can also be simulated by each thread taking a turn on the CPU.

namespace

How variables, classes and packages are defined in Java to logically group them.  Well-chosen namespaces are critical for comprehension and maintainability of code.

object

Any instantiated (constructed) class is an Object, so wherever object (in lower case) is used in this book it means the same.

open source

Software that also has the source code freely available.  You need a pretty good reason to use closed-source software on a project due to the long turn around time when a problem occurs.  Closed source code may never be able to provide a workaround if the development team no longer exists. But do your analysis to ensure an open source library is safe to use.

out of scope

When a variable is defined within a set of curly braces { ... } and the currently executing code goes past the } the variable goes out of scope and is no longer needed.  It then becomes a candidate for garbage collection.  (see 'scope' below).  

parent class

See superclass

persistence layer

A software module that communicates with a storage and retrieval system so that developer code does not have to do it throughout.  The idea is that the persistence layer could be changed to call to a web service instead of a database and developers wouldn't have to change a line of client code.

Thanks to persistence layers, developers generally no longer write SQL code or translate between Java data types and Database data types, saving a great deal of time on a project.  Databases particularly never converged into a single standard, so it makes sense to abstract them away with a persistence layer.

For example, Hibernate is an Object Relational Mapper that helps build a persistence layer.  Using just a few configuration changes it can switch from MySQL to Oracle, a wildly different database.

platform

This term originally referred just to the differences to consider when coding for each operating system platform, such as Linux, Windows, Solaris, Symbian  etc.

Now it can also refer to:

  • Coding restrictions: Android, Applet, JVM

  • Software modules: MySQL, Hibernate

  • Supported web browsers: Chrome, Mozilla Firefox, Internet Explorer, Safari.

  • Execution containers: Tomcat, Spring, Weblogic, Jboss, Websphere.

  • Hosting environment: AWS, ISP, Internal, External, Public Cloud, Private Cloud.

primitives

Also known as primitive data types or scalars, these are the fundamental types that are NOT objects, like int, long, float, double, boolean, byte, char.  An immutable class like Long is a wrapper class for the primitive type long.  Long is an Object, but long is not – it is a primitive type instead.

reference

Once an object has been created, any variable or collection that refers to the object does so using a reference. A reference is analogous to a memory pointer in C++ except that it need not be manually freed.

return value

An object or primitive data type returned by a method or function.

scope

Scope in terms of variables is the section of code where the variable is defined and active (available).   Normally the scope of a variable is the set of curly braces it is defined between ie. { ... }.

A variable can also have class scope (where it is a member variable in a class) or static global scope, where it is defined using the static keyword.

scope (web)

Web scope describe variables in web applications that have request, session, page or application scope.  A variable that has been defined in request scope can only be referenced while the single request is alive.  A variable defined in session scope can be referenced while the session is alive.

single-threaded

A single-threaded piece of code executes on its own.  There may be other threads running in the background for other purposes, but single-threaded code does not depend on any of them to be able to complete its work.

singleton

A class that only ever has one instance on a JVM, usually because it controls access to a resource that cannot handle multiple threads accessing it.  There is also a server-wide singleton, which is much more difficult to achieve since JVMs do not typically communicate with each other.

SME

Subject Matter Expert. This is a business representative who is in the best position to know what needs to be developed for a project to be successful.  Also known as the “Product Owner” in other Agile language, SME is pronounced “Smee” which is a little like “Smurf”.

stack

A stack is a data area or buffer used for storing items or things to do.  A stack is always a “push-down” list, meaning that as new items are added to the stack, they push down the old items further down - so the new item is at the top.   In reality the old items stay where they are in memory and the location of the top of the stack moves forward to cover the item just added. A program always takes its next item to handle from the top of the stack.  “On the stack” usually describes where local variables (ones that don't belong to an instance of the class) are created.  Local variables are added to the stack temporarily until the section of code goes out of scope, when they are popped back off the stack.

subclass

A new class defined using an existing (parent) class as a template.   A subclass extends a superclass/parent class.

superclass or parent class

A class that has been used as a template to create another class.  A subclass extends a superclass/parent class.

thread

A logical concept that describes a single executing piece of code.

threadsafe

Java code or a module designed to work flawlessly when multiple threads access it at the same instant.   Most code should be considered non-threadsafe unless otherwise specified.  HashMap, ArrayList and other basic collection types are not threadsafe because thread safety adds a performance cost.

view

Part of the Model View Controller (MVC) design pattern for GUI applications.  The view is the user interface that the consumer sees on the screen.

blog comments powered by Disqus