Topic Name

Subtopic Name

Learning Outcome(Slide2)

6

Basics of branding and messaging

5

Target audience and segmentation

4

Different marketing channels

3

Creating value for customers

2

Understanding customer needs

1

What marketing means ?

Choose cool, soft colors instead of vibrant colors
Max 6 Points for Summary & Min 4

Topic Name-Recall(Slide3)

Hook/Story/Analogy(Slide 4)

Transition from Analogy to Technical Concept(Slide 5)

What is DTO ?

DTO (Data Transfer Object) is a simple Java class used to transfer data between different layers of an application.

Purpose of DTO

Avoid exposing Entity directly to client

Transfer only necessary data

Customize API request and response

DTO Example

EmployeeDTO.java

public class EmployeeDTO {
 

private String name;

private String department;
 

// Getters & Setters

}

Simple POJO with only the fields needed for data transfer

Key Features

Lightweight
Contains only essential fields

Serializable
Easy to serialize for APIs

Encapsulated
Private fields with accessors

Validation in Spring Boot

What is Validation?

Validation is the process of checking whether the input data is correct, complete, and follows required rules before processing or storing it in the system.

User Input

Validate

Process

Why use Validations ?

Ensures only correct data is stored in the database.

Prevents runtime issues caused by bad input.

Provides clear error messages for incorrect input.

Maven Dependency Setup

To enable validation in Spring Boot, we add:

<dependency>

   <groupId>org.springframework.boot</groupId>

   <artifactId>spring-boot-starter-validation
</artifactId>

</dependency>

 

Without this dependency, validation annotations will not work

What This Does

Adds Hibernate Validator

Enables validation annotations

Integrates with Spring Boot

What is Bean Validation?

Bean Validation is a standard framework (API) used in Java to validate object fields (beans) using annotations.

Common annotations

@NotNull
Must not be null

@NotBlank
No empty or whitespace

@Min / @Max
Numeric range validation

@Size
String length validation

Common Use Cases

Form validation in web apps

API request validation

Data integrity enforcement

What are Custom Validations?

Custom validations are user-defined validation rules created when built-in annotations are not sufficient.

Common Use Cases

Email domain validation (company emails only)

Phone number format validation

Age restrictions based on business rules

Unique username validation

Custom validation annotations and attributes

@Documented

Includes annotation in JavaDocs

@Constraint

Links to validation logic

@Target

Where annotation is used

@Retention

How long annotation is available

message()

Defines validation error message

groups()

Groups validations logically

 payload() :

Carries custom metadata information

Example: @ValidPassword

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = PasswordValidator.class)
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)

public @interface ValidPassword {

    String message() default "Invalid password";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

Exception Handling

Exception Handling is a mechanism used to handle errors in an application so that it does not crash.

Why Needed in REST APIs?

It ensures that errors result in meaningful responses rather than abrupt failures.

Graceful error handling improves user experience and system reliability

Ensures API continues running even when errors occur

Helps identify and fix issues quickly

Returns clear responses like "Employee not found"

Checked Exceptions

  • Checked at compile time

  • Must be handled using try-catch or throws

  • Occur due to external factors

Unchecked Exceptions

  • Occur at runtime

  • Not checked at compile time

  • Usually caused by programming mistakes

Custom Exceptions

  • User-defined exceptions

  • Created to handle specific business logic errors

  • Inherit from Exception class

Types of Exceptions

Core Concepts (Slide 7)

Core Concepts (.....Slide N-3)

Summary

5

Build strong branding

4

Use different marketing channels

3

Target the right audience

2

Create and communicate value

1

Understand customer needs

Choose cool, soft colors instead of vibrant colors
Max 5 Points for Summary & Min 2

Quiz

Which platform is mainly used for professional networking and B2B marketing ?

A. Facebook

B. Instagram

C. LinkedIn

D. Snapchat

Quiz-Answer

Which platform is mainly used for professional networking and B2B marketing ?

A. Facebook

B. Instagram

C. LinkedIn

D. Snapchat