Spring Boot Microservices
------------------------------------------
1. REST API
2. REST API APplication
3. monolithic application
4. microservicess
5. spring cloud environment
7 components
a) service Registry / service configuration ---> Eureka Cloud Server
b) service disccovery -->
c) circuit Breakers (Resoulance 4j/ Hystrix)
d) API gate Way --> Spring-cloud-api-gateway
microservices communication purpose we used --> RestTemplate---> fiegnclient
e) messaging/ routings : robit MQ/ kafka
f) Load Balancing : zipkin tool
g) CI pipelines : zenkins + Junit
===============================================================
JavaScript
---------------
HTML : the use of HTML is design web pages
CSS: The use of CSS is styling web pages
JavaScript: validation+functinality of web pages
-----------------------------------------------------------------------------------
-------------------
Java Script
----------------
--> Java Script is a object -based and Object-oriented Prgraming Language.
--> The use of Java Script is provide functinality to the web pages and provide
validation to the
web forms.
--> By using JavaScript we can create a Dynamic web Pages. so that web page having
a user interface.
============================================================================
JavaScript Topics
=================
1. Variables : var, let and const
2. operators:
3. constrol statements:
4. javaScript functions: ( 1. by using function keyword + 2. arrow function)
5. Arrays: [10,20,30] (List)
6. JSON Object
-----------------------------------------------------------
ES-6 Features
-----------------
1. let var key words
2. arrow functions
3. spread Operators (rest Operator)
4. destructring
5. class and Object (constrctor() super())
6. dafult arguments
7. forEach(), forOf(), forIn()..etc
========================================
2. JavaScript Proramming Structure
==================================
--> Java Script code write with in the HTML program by using <script> Tag.
--> This <script> tag place in 2 ways a) with in the header Tag.
b) between the <body> Tag.
--> 3 way is external javaScript file( filename.js) extention.
syntax
--------
<html>
<head>
<script>
//Java Script Code
</script>
</head>
<body>
<script>
//Java Script Code
</script>
</body>
</html>
=============================================================
output statement
--------------------------
--> The use of out put statements are print out put in web page
a) window.alert()
b) console.log()
c) document.write()
-----------------------------------------------------------------------------------
-----
exp1:
--------
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<script>
console.log("Hi JavaScript");
console.log("Hi JavaScript");
window.alert("Welcome To JavaScript");
document.write("WELCOME TO JAVASCRIPT CODE");
</script>
</body>
</html>
===============================================
2. JavaScript Variables
======================
--> Variables are name of the memory location.
--> The use of variables are to hold the values in our program.(Data)
Data: number, decimal number ,character, string. and collection of data also.
--> in java Script variables are declare with 3 keyword var,let, const keyword.
1. var ----> using ES-5
2. let and const ---> ES-6
==================================================================
ex:
--
<body>
<h2>Welcome To JavScript</h2>
<script>
var rollNo; //variable declartion statement
rollNo=120; // initialization statement
var name="Yakub";
var salary=45000.00;
var designation="Trainer";
console.log("My RollNo=",rollNo);
console.log("My Name is=",name);
console.log("My Salary is=",salary);
console.log("My Designation is=",designation);
</script>
</body>
==========================================================
1. Explain var, let, and const.
• var: Function-scoped, can be redeclared and updated, hoisted (initialized as
undefined).
• let: Block-scoped, cannot be redeclared in the same scope, but can be
updated.
• const: Block-scoped, cannot be redeclared or updated (immutable reference,
but mutable objects).
•
Example:
var a = 10; // function-scoped
let b = 20; // block-scoped
const c = 30; // block-scoped, immutable reference
________________________________________
2. operators
-----------------
--> operators are symbols which is used to perform some operation between the
operands
ex: 5 + 6 = 11
Here 5, 6 are operands and + is a operator
1. Arthametic operator (+ - *,/ % // )
2. Relational Operators (< > <= >= == != )
3. Logical Operators (&& || !)
4. bitwise Operators ( & | ^ ~ << >> )
5. Assignment Operators (+= -= *+ /+ %= //= )
6. increment and decrement operators (++ -- ) --> var x=10; x++; x--;
7. conditional Operator (?:) --> Exp1?Exp2:Exp3;
-----------------------------------------------------------------------------------
---------------------
exp1:
---------
WAJP for addition of 3 numbers
---------------------------------------------
<script>
var num1=20;
var num2=30,num3=40;
var add=num1+num2+num3;
document.write("The Addition of 3 numbers are"+add);
</script>
===================================================
WAJP for simple Interest (si=(price*time*rate)/100;)
-----------------------------------------------------------------------------
Control Statement
=================
Control Statements
----------------------------
Control Statement in JavaScript are used to control the flow of program
execution based on specific condition or repeated operations. They are enable
descion-making ,lopping and Branching in a Program. its is called Conrol statement.
Basically Control Statement are 3 Types
---------------------------------------------------
1. Conditional Control Statement
-------------------------------------------------
a) if
b) if -else
c) if-else-if
d) nested if
e) switch
--------------------------------------------------------------------------
2. Looping / iteration/Repeatation control statement
----------------------------------------------------------------------------
a) while
b) do-while
c) for
d) forEach()
e) forOf()
f) forIn()
g) nested for
-------------------------------------------
3. Branching cotrol statement
------------------------------------------
a) break
b) continue
c) pass
==============================================
1. WAJP to check the given person valid for Vote or Not?
--------------------------------------------------------------------------
<script>
let age=21;
if(age>=18)
{
document.write("Valid for Vote");
}
else
{
document.write("Not Valid for Vote");
}
</script>
=====================================================
2. WAJP to fined The Biggest of 3 Numbers?
-----------------------------------------------------------------------------------
-
3. WAJP to print number from 1 to 10?
--------------------------------------------------------
<script>
for(let i=1; i<=10; i++)
{
document.write(i+"<br>");
}
</script>
-------------------------------------------------------------------
4. WAJP for Multiplication Table?
5. WAJP print even numbers between 100 to 200?
-----------------------------------------------------------------------
************Java Script Functions****************
---------------------------------------------------------------------
. Function is a re-usable “block” of the program, which is a set of statements with
a name.
• The large program can be divided into many parts; each individual part is called
as “function”.
• Functions are re-usable. That means functions can be called anywhere and any no.
of times within
the program.
-----------------------------------------
Advantages of Functions
-------------------------------------
1. No duplication code means less code
2. provide reusability of code
3. provide readability
4. provide modularity of program
-----------------------------------------------------------------------------------
------
Preparation of Function
---------------------------------
--> to prepare function in JS by using "function" key word.
Syntax for Preparation called Function
----------------------------------------------------
function <function_name>(para1,para2,...................para_n)
{
stmt1
stm2
stm3
}
================================================================
Note: the above function won't execute it self, we need to call the function by
using function name
i.e called calling function.
==============================================================
Syntax for calling function preparation
-------------------------------------------------------
<function_name>(val1,val2......val_n);
<function_name>();
let objname=<function_name>(val1,val2......val_n);
let objname=<function_name>();
========================================
ex:
----
<html>
<head>
</head>
<body>
<script>
function addition(n3) // called function
{
let n1=10;
let n2=40;
let add=n1+n2+n3;
document.write("Addition od two numbers="+add+"<br>");
}
addition(50); // calling function
addition(30); // calling function
</script>
</body>
</html>
================================================