You are on page 1of 9

Software engineering notebook

By Hamza Adnan

12 FEBRUARY 2024
Starling bank
Contents
Introduction...........................................................................................................................................2
Course Plan............................................................................................................................................2
Java Master Class...................................................................................................................................2
Introduction
This document will contain notes whilst learning software engineering via the AmigosCode platform
covering the below topics: Java, Object-Oriented Programming, PostgreSQL, Spring Boot, Spring
Security, Docker, IntelliJ IDEA, SOLID Principles, POSTMAN, Git, DevOps, CI-CD, JavaScript, React,
Node, Mongo, SCRUM, AWS, GitHub Actions, Linux Terminal, Kubernetes, Microservices, Material
UI/Tailwind/Bootstrap, Flutter, VS Code

Course Plan
Java Master Class – Bootcamp (20hrs)

Full Stack Professional – Expand Relevant Sections with the following courses:

- Databases – Database Design and Implementation / Advanced Databases


- JavaScript – Expand with ‘JavaScript Mastery’
- Docker/Kubernetes – Docker for DevOps Engineers / Mastering Kubernetes
- Unit Testing – Expand with ‘Software Testing’
- IntelliJ IDEA – Expand with ‘IntelliJ IDEA Developer Guide’

Additional ‘Microservices and Distributed Applications

Build Projects along the way / Portfolio (Expand Project Built):

Ticket Management System

Management System

Bank Application

E-Commerce Site

Social Network

Features: Dark Theme, Messaging, User Counter, Refresh UI, Text Change, Markup, Document
Upload/Download

Java Master Class


 Java is an Object-Oriented Language: this simply means that programs in Java are based
around Objects i.e. a cup, remote, drink – those objects are then connected. Object-Oriented
applications are modelled around real-world objects. Data types are also objects i.e. strings.
 Created by James Gosling in 1985, used for developing enterprise applications.
 Java powers applications within 3 billion supported devices.
 Like C++ but simpler as there are no processes such as memory management, after learning
Java it is very easy to learn languages like C#, Golang, Python etc.
 You can build Android, Desktop (JavaFX, Java Swing), Games like Minecraft, Enterprise
applications (banking applications), cloud and web applications using Spring.
 Java is a language for the business logic / back-end i.e. “the brains” whereas the front-end is
what the user sees i.e. buttons, colours,
text etc. JavaScript and frameworks like
React assist with this.
 The back-end also deals with logic such as
“Do you want to buy a new phone” 
“Checks your balance to see if enough
credit”  “If not card declined”.
 The client (user on the front-end), the
client sends a request to the back-end, the
N-tier architecture (as shown in the
screenshot), Java takes the request, the
business layer then makes the decision and
this is followed through to the data layer
against a database. The server / API would
send the response.
 When it comes to Java it is used for
enterprise application development by
huge companies such as Apple, Starling,
Uber, Netflix etc.

 The IDE used is IntelliJ IDEA, where the UI was also built in Java Swing Framework as well as
all other elements.

Java IS NOT JavaScript

Java is a complied / interpreter language used for back-end development, whereas JavaScript is a
interpreted language meant for the web browser and some back-end work with the Node runtime
and express framework.

The compiler is a special program that processes statements written in a particular programming
language and turns them into machine language or “code” that a computer’s processor uses to
perform an operation.
Whereas an interpreter reads each statement of code and then converts or executes it directly. There
is NO complier or conversion to binary so that the CPU can execute, this is a completely different
process.

Complied: Interpreted:
Code can be executed directly by a computer’s Another program executes the code (Node or
CPU. Chrome browser)
Code must be transformed into machine No transformation needed, runs direct against
readable instructions. the interpreter rather than compiling.
Runs Faster. Slower
Better performance. Faster for development.
Examples of languages include: C++, C#, Java, Examples of languages include: JavaScript,
Golang. Python.

Static vs Dynamic Type Checking

Type: AKA data type is a classification identifying one of various TYPES OF DATA i.e. strings, integers,
objects, arrays, maps. The process for verifying and enforcing constraints i.e. type checking may
occur either at compile time (static check i.e. Java) or at run time (dynamic check i.e. JavaScript)

A language that is statically-typed if the type of a variable is known at compile time instead of at
runtime. This allows for errors to be caught early in the development cycle. Whereas dynamic is the
process of verifying the type safety of a program at run-time, examples include: Objective-C, Python,
PHP, Ruby.

Complied meaning that any issues are known before hand and stop the application from running i.e.
squiggly line in IntelliJ or Visual Studio. Whereas an interpreted language would continue to run even
if you put ‘foo’ within your code.

Code Structure

Syntax Notes:

// Single Line Comments,

/*

Multi-line comment

*/

Primitive types are used for storing simple values i.e. int, char, string, double and Boolean, long, float,
short.
package com.amigoscode;

public class Main {


public static void main(String[] args) {
int number1 = 20;
int number2 = 20;
int result = number1 + number2;
System.out.println(result);

double pi = 3.14;
boolean isAdult = false;
char a = 'A';

Note: Underscores can be used for large numbers foe code readability purposesi.e.

int amount = 1000_000_009;

Arithmatic operators:

int numberOne = 10;


int numberTwo = 3;

System.out.println(numberOne + numberTwo);
System.out.println(numberOne - numberTwo);
System.out.println(numberOne * numberTwo);
System.out.println(numberOne / numberTwo);
System.out.println(numberOne % numberTwo);
Note the % is the modulus operator, it displays the reminder of how many times a number can get
divided into a number i.e. 10 / 3, with a reminder of 1, therefore 1 will be output to the console.

Follow BODMAS for the order of operations above, so that you know which supersedes and takes
precedence.

++ is the increment operator this is the same as number = number + 1 for example;

int number = 0;
System.out.println(number++);
System.out.println(number);

System.out.println(number++) // this will output 0 to the console.

System.out.println(number)// this will output 1 to the console.

int numberTwo = 0;
System.out.println(++numberTwo);
System.out.println(numberTwo);

Note that adding ++ in front of numberTwo would immediately increment the value to 1. Therefore
System.out.println(++numberTwo) //this would output 1

-- this is the decrement operator/

int number = 0;
System.out.println(number--);
System.out.println(number);
int numberTwo = 0;
System.out.println(--numberTwo);
System.out.println(numberTwo);

System.out.println(number--); //this would output 0

System.out.println(number); //this would output -1

System.out.println(--numberTwo); //this would output -1 immediately.

NOTE: += is the same as variableOne = VariableOne + 1;

The same can be applied to other arithmetic operators i.e. *=, -=, /=, %= etc.
Casting

double salary = 5423.94;


int roundedSalary = (int)salary;
System.out.println("Mortgage Broker: What
is your monthly salary in dollars?");
System.out.println("My monthly salary is:
" + roundedSalary);

Casting is a method of explicit conversion. In the case of the above example, salary is initially
declared as a double, this needs rounding to the nearest whole number therefore:

int roundedSalary = (int)salary;

We set the salary amount to the rounded salary, however we convert/cast the ‘int’ value before it,
because int is not used for decimal numbers, therefore the output of this would be ‘5423’ with the
conversion being concluded and data loss occurring taking away the ‘0.94’.

You might also like