Chapter 3
Chapter 3
Dr.Chaya Ravindra
Associate Professor
TYPES OF SLA
1. Customer-level SLA
A customer-based SLA is an agreement that covers all of the
services used by a customer. A customer service level agreement
covers specific details of services, provisions of service availability,
an outline of responsibilities, escalation procedures, and terms for
cancellation.
2.Service-level SLA
A service-level SLA is a contract that details an identical service
offered to multiple customers. For example, if a service provider had
multiple clients using its virtual help desk, the same service-based
SLA would be issued to all clients.
TYPES OF SLA
3.Multi-level SLA
This type of agreement is split into multiple levels that integrate
several conditions into the same system. This approach is suitable
for providers that have many customers using their product at
different price ranges or service levels. These differing service levels
can be built into a multi-level SLA
COMMON ELEMENTS OF A
SERVICE LEVEL AGREEMENT
Agreement overview
An agreement overview includes the start and end dates of an SLA, details of the
parties involved, and an overview of the services included.
Description of services
A description of services outlines all services provided within an SLA. It details
information such as turnaround times, technologies and applications, maintenance
schedules, and processes and procedures.
Exclusions
This section describes all exclusions and exemptions that are agreed upon by both
parties.
Service level objective
A service level objective (SLO) is an agreement within an SLA about a specific metric
like response time or uptime. Both parties agree to key service performance metrics
backed by data.
COMMON ELEMENTS OF A
SERVICE LEVEL AGREEMENT
Security standards
Both the service provider and the client use security standards to demonstrate the security
measures and protocols in place. This section also commonly includes non-disclosure agreements
(NDAs) and anti-poaching agreements.
Disaster recovery process
An SLA will often detail the process of disaster recovery and outline the mechanisms and processes
to follow in case of service failure of the vendor. This section also includes information on the
restarting process, including restart times and alerts.
Service tracking and reporting agreement
In this section, performance metrics are agreed upon by both parties. Most customers closely track
their service performance. A reasonable baseline for this tracking would be before and after using a
new service provider.
Penalties
This section clearly states the penalties, financial or otherwise, that either side incurs if they fail to
live up to their SLA obligations.
Termination processes
There may come a time when you want to bring your agreement to an
end. In addition to requiring a notice period from either party, the SLA
also clearly outlines the circumstances that permit termination or
expiration.
Review and change processes
It is important that you regularly review your SLA and any key
performance indicators (KPIs) that you are using to measure
performance. Any large-scale changes in your requirements need to be
recorded in the agreement.
Signatures
The agreement to each item contained in the document is reviewed
and signed by authorized individuals and pertinent stakeholders from
both sides. As long as the agreement is in effect, both parties are
bound by it.
LIFE CYCLE OF SLA
JAVA !
The Java programming is claimed as
Simple Robust
Object-
Portable
Oriented
Secure
Java Architecture
Neutral
High
Dynamic
Performance
Platform
Multithreaded
Independent
Interpreted
CURRENT POPULARITY
Java has Platform
Language Score worldwide Independence
popularity
Java offers
Parallel and
Distributed
backward
development compatibility
Assembler
Interpreter
Compiler
THIRD GENERATION PROGRAMMING
LANGUAGES
• A third generation (programming) language (3GL) is a grouping of programming languages that introduced significant enhancements to second
generation languages, primarily intended to make the programming language more programmer-friendly.
• English words are used to denote variables, programming structures and commands, and Structured Programming is supported by most 3GLs.
• Commonly known 3GLs are FORTRAN, BASIC, Pascal, JAVA and the C-family (C, C+, C++, C#, Objective-C) of languages. Also known as a
high-level programming language.
FUNCTION-ORIENTED
PROGRAMMING
OBJECT-ORIENTED PROGRAMMING
TOKEN
Program organization Program is divided into small parts called functions. Program is divided into parts called objects.
Importance Importance is not given to data but to functions Importance is given to the data rather than procedures
Approach FOP follows top down approach OOP follows bottom up approach
Access Specifiers Does not have any access specifier Has three access specifiers, namely Public, Private, Protected
Data Moving Data can move freely from function to function in the system Objects can move and communicate with each other
Maintainability To add new data and function is not so easy Provides an easy way to add new data and function
Function uses global data for sharing that can be accessed freely from function to function in the
Data Access system. Object uses local data and can be accessed in a control manner
Data Hiding No data hiding is possible, hence security is not possible Provides data hiding, hence secured programming is possible
• Encapsulation
• Inheritance
• Information hiding
• Polymorphism
FEATURES OF JAVA PROGRAMMING
Interfaces Multithreading Java multimedia Java script
1. class StudentInfo {
2. public static void main(String args[]) {
3. System.out.println("Name: Akshay Anand");
4. System.out.println("Class: 10");
5. System.out.println("Roll No.: 5");
6.
7. }
8. }
C VERSUS JAVA
Aspects C Java Aspects C Java
Paradigms Procedural Object-oriented Supported
Inheritance No inheritance (Simple
Platform inheritance)
Dependency Dependent Independent
Pointers Supported No Pointers
Datatypes : union,
structure Supported Not supported Code translation Compiled Interpreted
The Java compiler ( javac ) converts a Java program into Java byte
code
– Move to the directory where your Java program has been saved
javac HelloWorldApp.java
JAVA PROGRAM COMPILATION
JAVA PROGRAM COMPILATION
JAVA PROGRAM EXECUTION
java HelloWorldApp
JAVA PROGRAM EXECUTION
JAVA PROGRAM EXECUTION
C/C++ versus Java execution
C
JAVA
C++ VERSUS JAVA
Areas of applications
– C++ is best suitable for developing large software.
• Library management system, Employee management
system, Passenger reservation system, etc.
Java
compiler
Java BYTE
code
JVM
C++
Complier Java Java Java
interprter interprter interprter
C++ source C++ object WIN32 Solaris Macintosh
code code
C++ provides platform dependent programming Java provides platform independent programming
TOOLS AVAILABLE FOR JAVA
PROGRAMMING
– Contains the basic tools and libraries necessary for creating, testing,
documenting and executing Java programs.
• java.util – it contains miscellaneous classes like Vector, Stack, List, Date, Dictionary,
Hash etc.
• Mojo from Penumbra Software (best visual environment for creating Java
applets)
1.Web browser
NotePad++ - https://notepad-plus-plus.org/download/v7.5.8.html
In Java, every variable has a type declared in the source code. There are two
kinds of types: reference types and primitive types. Reference types are
references to objects. Primitive types directly contain values.
int a, b = 0;
a = 123;
b = 45;
int c = a + b;
marks.length = n
Example:
int x [ ] = new int [100];
STORING ELEMENTS IN ARRAY
Initialization of Array
<arrayName> [<subscript> ] =
<value>; Example:
x [5] = 100;
values> }; Example:
int x [ ] = {12, 3, 9, 15};
• The concept of class is the logical construct upon which the entire Java
language is built.
WHAT IS A CLASS?
• A class is a group of objects, which have common
properties. Fields
• It is a template or blueprint from which objects are
created. Methods
• It is a logical entity.
Constructors
A class in Java can contain:
Blocks
• Fields
• Methods Nested Class
• Constructors
• Blocks Interfaces
• Nested class(es) and interface(s)
GENERAL STRUCTURE OF A CLASS
class <class-name>{
<type> <variable 1>;
<type> <variable 2>;
<type> <variable 3>;
...
<type> <variable n>;
class Circle {
double x, y; // The coordinates of the center r
double r; // The radius
} (x, y)
ADDING METHODS TO CIRCLE
CLASS
class Circle {
double x,y; // The coordinates of the center
double r; // The radius
You can only create a method within a class. There are a total of six
components included in a method declaration.
The components provide various information about the method.
Below is the syntax to declare a method and its components list.
It is used to define the access type of the method. The above syntax
sees the use of the “public” access specifier. However, Java provides
four different specifiers, which are:
• Public: You can access it from any class
• Private: You can access it within the class where it is
defined
• Protected: Accessible only in the same package or other
subclasses in another package
• Default: It is the default access specifier used by the Java
compiler if we don’t mention any other specifiers. It is
accessible only from the package where it is declared
RETURNTYPE:
It defines the return type of the method. In the above syntax, “int”
is the return type. We can mention void as the return type if the
method returns no value.
Method name:
1. It is used to give a unique name to the method. In the above
syntax, “addNumbers” is the method name. This tutorial looks at
some tips for naming a method, shortly.
PARAMETER LIST:
• Static Method
• Instance Method
• Abstract Method
• Factory Method
STATIC METHOD
APPLYING INSTANCE METHODS IN
JAVA CODE
INSTANCE METHODS ARE
FURTHER DIVIDED INTO TWO
TYPES:
• Accessor Method
1. It is used to get a private field’s value, accessor methods in Java
can only read instance variables. They are always prefixed with
the word ‘get’.
• Mutator Method
1. It is used to get and set the value of a private field, mutator
methods in Java can read and modify instance variables. They
are always prefixed with the word ‘set’.
USING ABSTRACT METHODS
IN JAVA
FACTORY METHOD
1. Factory methods are the ones that return an object to the class
where it belongs. Usually, all static methods also fall into this
type of method.
DECLARING OBJECT OF TYPE
CIRCLE CLASS
// A program that uses the circle class
// Call this file circledemo1.java
class Circle { //The following class declare an object of type Circle
double x,y; // The coordinates of the center class CircleDemo1 {
double r; // The radius public static void main(String args[]){
Circle c = new Circle();
// Method that returns circumference c.x = 0.0;
double circumference(){ c.y = 0.0;
return 2*3.14159*r; c.r = 5.0;
} System.out.println("Circumference" +
// Method that returns area c.circumference());
double area(){ System.out.println("Area" + c.area());
return (22/7)*r*r; }
} }
}
MULTIPLE OBJECTS DECLARATION
class
class Circle {
Box{ double
double x,y; width; double
double r; height; double
double circumference(){ depth; double
area(){
return 2*3.14159*r;
double a;
} a = (width*height + height*depth + width*depth) * 2;
double area(){ return a;
return (22/7)*r*r; }
double volume(){
}
double v;
} v =
width*height
*depth;
return v;
}
}
MULTIPLE CLASS OBJECTS
3. The name of the program file should be same as the name of the main
class followed by .java as an extension.
3. This method has the same name as the class in which it resides.
4. Once defined, the constructor is automatically called immediately after object is created.
6. In fact, the implicit return type of a class constructor is the class type itself.
2. Sometimes a method will need to refer to the object that invoked it.
4. this can be used inside any method to refer to the current object.
5. That is, this is always a reference to the object on which the method
is invoked.
CONSTRUCTOR : AN EXAMPLE
class Circle class Circle
{ double { double
x,y; double x,y; double
r; r;
double circumference(){ double circumference(){
return 2*3.14159*r; return 2*3.14159*r;
} }
double area(){ double area(){
return (22/7)*r*r; return (22/7)*r*r;
} }
void setCircle(double a, double b, double c){ Circle (double x, double y, double r)
x = a; // Set center x-coordinate { this.x = x; // Set center x-
y = b; // Set center y-coordinate r = coordinate this.y = y; // Set center
c; // Set radius y-coordinate this.r = r; // Set radius
} }
} }
class CircleDemo5 {
public static void main(String args[])
{ Circle c1 = new Circle();
c1.setCircle(3.0,4.0,5.0);
Circle c2 = new Circle (-
4.0,8.0,10.0);
System.out.println("Circumference Circle 1" + c1.circumference());
System.out.println("Area Circle 1" + c1.area());
System.out.println("Circumference Circle 2" + c2.circumference());
System.out.println("Area Circle 2" + c2.area())
}
}
2. In that case, this can be used from one constructor to invoke one of
the other constructor of the same class.
THIS WITH MULTIPLE
CONSTRUCTORS : AN EXAMPLE
class Circle
{ double x,
y; double r;
Circle (double x, double y, double r){
this.x = x; this.y = y; this.r =
r;
}
Circle (double r)
{ this(0.0, 0.0, Note:
r);
1. There is a very important restriction on the this syntax.
}
Circle (Circle c) 2. It should appear only as the first statement in a
{ this(c.x, c.y. constructor.
c.r);
}
Circle (){
this(0.0, 0.0, 1.0);
}
double circumference(){
return 2*3.14159*r;
}
double area()
{ return
(22/7)*r*r;
}
}
THIS KEYWORD
INHERITANCE IN JAVA
•Sub Class/Child Class: Subclass is a class which inherits the other class. It is
also called a derived class, extended class, or child class.
•Super Class/Parent Class: Superclass is the class from where a subclass
inherits the features. It is also called a base class or a parent class.
•Reusability: As the name specifies, reusability is a mechanism which facilitates
you to reuse the fields and methods of the existing class when you create a new
class. You can use the same fields and methods already defined in the previous
class
INHERITANCE
TYPES OF INHERITANCE IN
JAVA
TYPES OF INHERITANCE IN
JAVA
SINGLE INHERITANCE
EXAMPLE
MULTILEVEL INHERITANCE
EXAMPLE
HIERARCHICAL INHERITANCE
EXAMPLE
MULTIPLE INHERITANCE IS
NOT SUPPORTED IN JAVA
int myArray [ ] [ ];
myArray = new int [3]
[4];
OR
int myArray [ ] [ ] = new
int [3] [4];
LOADING A 2D ARRAY
Initializing a 2D array : An
example1 2 3
4 5 6
OR
int myArray [ ] [ ] = { {1, 2, 3}, {4, 5, 6} };
VARIABLE SIZED 2D ARRAY
x[0
]
x[1
]
x[2
]
Creating a variable-sized 2D array Another way: Example
<type><2DarrayName>[][] = new <type> [<rowSize>][]; int x [ ] [ ] = new int [3][ ];
for (int i = 0; i < <rowSize>; i++) x[0] = new int [2];
x[1] = new int [4];
<2DarrayName>[i] = new <type> [<colSizei x[2] = new int [3];
>];