0% found this document useful (0 votes)
50 views5 pages

OOP Types and Features 1. Class: Class Is A Collection of Data-Member and Member Functions

1. OOP concepts like class, object, abstraction, encapsulation, inheritance and polymorphism allow developers to model real-world problems in software. Classes group data and functions, objects are instances of classes. Inheritance creates new classes from existing ones. 2. State management techniques maintain application data across requests. Client-side uses viewstate, hidden fields and cookies stored on the browser. Server-side uses session state and application state stored on the server. 3. .NET supports common data types like integers, floats, characters, Booleans, strings and DateTime for representing different kinds of data in memory and applications. Each type has a predefined size and range of possible values.

Uploaded by

Mit Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views5 pages

OOP Types and Features 1. Class: Class Is A Collection of Data-Member and Member Functions

1. OOP concepts like class, object, abstraction, encapsulation, inheritance and polymorphism allow developers to model real-world problems in software. Classes group data and functions, objects are instances of classes. Inheritance creates new classes from existing ones. 2. State management techniques maintain application data across requests. Client-side uses viewstate, hidden fields and cookies stored on the browser. Server-side uses session state and application state stored on the server. 3. .NET supports common data types like integers, floats, characters, Booleans, strings and DateTime for representing different kinds of data in memory and applications. Each type has a predefined size and range of possible values.

Uploaded by

Mit Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

OOP Types and features


1. Class:

Class is a collection of data-member and member functions. Class will not occupy any
memory space; hence it is only logical representation of data by object
declaration.

Classes that can be used to instantiate objects are called concrete classes.
2. Object:

An object is an instance of class. Object is basic unit to perform various


operations on class.

3. Abstraction

Process of hiding the details of a class from outside of the program world is
called as data abstraction. Advantage of data abstraction is security.

4. Encapsulation
process of wrapping up of data and functions into a single unit is called as data
encapsulation.
5. Inheritance

Creating a new class from an existing class as well as utilizing the property and
functionalities of an existing class is called as Inheritance.

The class which is inherited is called as the Base class & the class which inherits is
called as the Derived class. They are also called parent and child class.
6. Polymorphism

Polymorphism means having more than one form.

Polymorphism can be achieved with the help of overloading (means same


function name with different argument . which is compile time called early
binding) and overriding (means same function with same argument which is
runtime called late binding).

Polymorphism is classified into compile time polymorphism and runtime


polymorphism.

It is a feature, which lets us create functions with same name but different
arguments, which will perform different actions. That means, functions with same
name, but functioning in different ways (function overloading). Or, it also allows us to
redefine a function to provide it with a completely new definition (function
overriding).

7. Constuctor and Destructor

Constructor is a special function in a class when that is called a new “object” of the
class is created.

A destructor is also a special function which is called the created object is deleted.
2.
3. State Management can be defined as the technique or the way by which we can maintain / store
the state of the page or application until the User's Session ends.

State Management Types

1. Client-side Management

o Viewstate
o Hidden field
o Cookies
o Control State
o Query Strings

2. Server-side Management

o Session State
o Application State

1.1. Viewstate is used to maintain or store user data temporarily after a post-back.
1.2. A hidden field is used for storing small amounts of data on the client side. It is invisible in the
browser.
1.3. Cookies is a small text file that is stored in the user's hard drive using the client's browser. it only
stores information such as sessions id's, some frequent navigation or post-back request objects.
The cookie’s access depends upon the life cycle and expiration of that specific cookie file.
1.3.1. Persistent Cookie

Cookies having an expiration date is called a persistent cookie. This type of cookie reaches
their end as their expiration dates comes to an end. In this cookie we set an expiration date.
1.3.2. Non-Persistent Cookie

Non-persistent types of cookies aren't stored in the client's hard drive permanently. It
maintains user information as long as the user access or uses the services. It’s simply the
opposite procedure of a persistent cookie.

1.4 Control state is based on the custom control option. For expected results from CONTROL STATE
we need to enable the property of view state. As I already described you can manually change those
settings.

1.5 Query Strings used for holding some value from a different page and move these values to the different
page. The information stored in it can be easily navigated to one page to another or to the same page as
well.

2.1 Application State

1. If the information that we want to be accessed or stored globally throughout the application, even
if multiple users access the site or application at the same time, then we can use an Application
Object for such purposes.
2. It stores information as a Dictionary Collection in key - value pairs. This value is accessible across
the pages of the application / website.
3. There are 3 events of the Application which are as follows
o Application_Start
o Application_Error
o Application_End

2.2 Session State

Session is one of the most common way which is being used by developers to maintain the state
of the application. The Session basically stores the values as a dictionary collection in key/value
pairs. It completely utilizes server resources to store the data. It is a secure way of storing data,
since the data will never be passed to the client.

For each and every user, a separate Session is created, and each and every Session has its Unique
ID. This ID is being stored in the client's machine using cookies. If there are multiple users who are
accessing a web application, then for each user a separate Session is created. If a single user logs
in and logs out the Session is killed, then if the same user again logs into the application, then a
new Session ID is being created for the same user.

The Session has a default timeout value (20 minutes). We can also set the timeout value for a
session in the web.config file.

C# Data Types
.NET Size
Alias Type Type (bits) Range (values)

byte Byte Unsigned integer 8 0 to 255

sbyte SByte Signed integer 8 -128 to 127

int Int32 Signed integer 32 -2,147,483,648 to 2,147,483,647

uint UInt32 Unsigned integer 32 0 to 4294967295

short Int16 Signed integer 16 -32,768 to 32,767

ushort UInt16 Unsigned integer 16 0 to 65,535

long Int64 Signed integer 64 -9,223,372,036,854,775,808 to


9,223,372,036,854,775,807

ulong UInt64 Unsigned integer 64 0 to 18,446,744,073,709,551,615

float Single Single-precision floating point type 32 -3.402823e38 to 3.402823e38

double Double Double-precision floating point type 64 -1.79769313486232e308 to


1.79769313486232e308

char Char A single Unicode character 16 Unicode symbols used in text

bool Boolean Logical Boolean type 8 True or False

object Object Base type of all other types

string String A sequence of characters

decimal Decimal Precise fractional or integral type that can represent 128 (+ or -)1.0 x 10e-28 to 7.9 x 10e28
decimal numbers with 29 significant digits

DateTime DateTime Represents date and time 0:00:00am 1/1/01 to 11:59:59pm


12/31/9999

You might also like