Strategy Design Pattern With DI - 10th June 2022 Notes
Strategy Design Pattern With DI - 10th June 2022 Notes
++++++++++++++++++++++++++++++++++++++++++++++++
=> How job opportunites are available for Spring Boot & Microservices
Pre-Requisites
++++++++++++++
1) Core Java
3) SQL (CRUD)
2) Spring Boot
6) Spring Cloud
7) Microservices
8) Spring Security
-> Every java developer should learn Spring Boot & Microservices
(both freshers & experienced)
-> To get job as a java developer we need to have very good knowledge in SBMS
-> To survive in IT as a java developer we need to have very good knowledge in SBMS
-> Now a days all java projects are using SBMS only
-> Every company asking for Spring Boot & Microservices resources only
====> For 3 years java developer with SBMS ===> 15+ lakhs package
Course Info
+++++++++++
Name : Spring Boot with Cloud & Microservices
Course Code : 19-SBMS
Start Date : 01-Jun-2022
Class Time : 7 AM - 8:15 AM IST (Mon - Sat)
Duration : 3.5 Months
Course Fee : 7,000 INR (Live Classes + Daily ClassNotes)
For Backup Videos : 3,000 INR (6 months access)
Note: After completion of SBMS, you are equal to 4+ years exp Spring Boot
developer.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Application Development
++++++++++++++++++++++++
1) Backend Development
2) Frontend Development
(presentation logic)
=> End users interact with frontend of our application. Frontend will interact with
Bakend of our application. Backend will execute business logic and it will
communicate with database also.
=> The developers who can do both backend development and front end development
they are called as Fullstack Developers.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
Monolith Vs Microservices
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
+++++++++++++++
Java Road Map
+++++++++++++
=> SQL
=> Microservices
=> Security
=> Spring Boot is just one approach to develop Spring Based applications with less
configurations.
=> Spring Boot came into market with Auto Configuration concept
Note: Spring Boot will take care of configurations required for our application.
Realtime Tools
++++++++++++++
Maven
Git Hub
JIRA
-----------------------------------------------------------------------------------
--------------
Spring Framework
-----------------------------------------------------------------------------------
-------------
2) What is Framework ?
-> If we use framework in our application development then we need to focus only on
business logic
(frameworks will provide common logics required for our application)
Struts : It is a web framework. Used to develop only web layer of our application.
(Spring can be integrated with any other java framework available in the market)
(spring framework will not force us to use framework related interfaces or classes)
Note: In Spring we can create a simple pojo and we can ask spring to execute our
pojo
-----------------------------------------------------------------------------------
----------
Spring Modules
-----------------------------------------------------------------------------------
----------
1) Spring Core
2) Spring Context
3) Spring DAO / Spring JDBC
5) Spring AOP
6) Spring ORM
7) Spring Web MVC
8) Spring Security
9) Spring REST
10) Spring Data
11) Spring Cloud
12) Spring Batch etc...
Note: Spring framework is loosely coupled. It will not force to use all modules.
-> Based on project requirement we can choose which modules we need to use from
Spring.
Note: Spring Core is the base module for all other modules in Spring. To work with
any module in spring first we need to know Spring Core module.
-----------------------------------------------------------------------------------
----------
-> Spring Core Module is base module in Spring Framework. It is providing IOC
container & Dependency Injection.
-> Spring Context module will deal the configuration related stuff
-> AOP stands for Aspect Oriented Programming. Spring AOP is used to deal with
Cross Cutting logics in application.
Note: We can seperate business logic and cross cutting logic using AOP module.
-> Spring JDBC / Spring DAO module used to develop Persistence Layer
-> Spring ORM module is used to develop Persistence Layer with ORM features.
-> Spring Security module is used to implement Security Features in our application
(Authentication & Authorization)
-> Spring Cloud providing Cloud concepts like Service Registry, Cloud Gateway,
Filters, Routing, FeignClient etc..
-> Spring Batch is used to implement Batch Processing in our application. Batch
Processing means bulk operation.
-----------------------------------------------------------------------------------
----------------
-----------------------------------------------------------------------------------
--------------------
Spring Core
-----------------------------------------------------------------------------------
-------------------
=> All the other modules of Spring are developed on top of Spring Core Module only
=> Spring Core is all about Managaing dependencies among the classes
(Creating Objects & Injecting Objects)
-----------------------------------------------------------------------------------
--------------------
1) Inheritence
2) Composition
-> If we use Inheritence or Composition then our classes will become tightly
coupled.
-> Instead of we are creating objects we can ask Spring Core to manage dependencies
among our classes
-----------------------------------------------------------------------------------
-------------------
-> If we want Spring Core Module to manage dependencies among the classes with
loosely coupling then we have to develop our classes by following some best
practises.
-----------------------------------------------------------------------------------
----------
Strategy Design Pattern
-----------------------------------------------------------------------------------
----------
-> It comes under Behavioural Design Pattern
-> When we have multiple algorithms then we can use this pattern to choose one
algorithm at run time
Rules
+++++
3) Code should be open for extension and code should be closed for modification
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
Dependency Injection
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
-> The process of injecting one class object into another class object is called as
Dependency Injection
1) Setter Injection
2) Constructor Injection
3) Field Injection
-> The process of injecting one class object into another class object using Setter
method then it is called as Setter Injection.
Ex ::
BillCollector bc = new BillCollector();
bc.setPayment(new CreditCardPayment());
-> The process of injecting one class object into another class object using
Constructor is called as Constructor Injection
Ex::
-> The process of injecting one class object into another class objet using
variable is called as Field Injection.
Note: If variable is declared as public then we can access that variable outise of
the the class we can initialize directley.
Note: If variable is declared as private then we can't access that variable outside
of the class directley. To access private variables outside of the class we can use
Reflection api.
-----------------------------------------------------------------------------------
----------
package in.ashokit;
import java.lang.reflect.Field;