Вы находитесь на странице: 1из 14

OOP

OOP
Object-Oriented Programing
Methodology, programs organized as collection of objects, objects instance of some class.
Concepts: Class, Object, Inheritance, Polymorphism, Abstraction, Encapsulation.

CLASS
Definition of an object.
Template or set of instructions to build a specific type of object.
Default modifier as Internal.

OBJECT
Instance of class.

OOP ADVANTAGES
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation

INHERITANCE
Ability create new classes. Extends & modify behavior defined by other class.

POLYMORPHISM
Represent more than one type of object.
Virtual & override

ABSTRACTION
Programmer hides all but the relevant data about an object.
Abstract class is a class that cannot be instantiated, it must be inherited

ENCAPSULATION
Levels of accessibility. Public, Protected, Private, Internal.
Used to separate parts of the code from the rest of the program
INSTANCE
Also called as an object.
Has state, behavior and identity.
Default modifiers as Public.

INTERFACE
An abstract class with only public abstract methods & methods only have declarations and not the
definition.
Default modifiers as Public.

STRUCT VS CLASS
Classes are passed by reference, structs are passed by value.
Classes can be inherited, but Structs cannot.
Structs generally give better performance with default modifiers as Internal.

BASE & DERIVED CLASS


Base is the class from the class was derived.
Base is the parent class and Derived is the child one.

PUBLIC, PRIVATE, PROTECTED & INTERNAL

Public
The type or member can be accessed by any other code in the same assembly or another
assembly that references it.

Private
The type or member can be accessed only by code in the same Class or Struct.

Protected
The type or member can be accessed only by code in the same Class or Struct, or in a class that is
derived from that class.

Internal
The type or member can be accessed by any code in the same assembly, but not from another
assembly.
C#
OVERLOAD
Same name method implementation with different numbers or types of parameters

OVERRIDE
Re-write a method and can be convinced with original method through base keyword.

ERRORS
Syntax error: Incorrect code syntax.
Logic error: program output an unexpected result.
Runtime error: program to crash or terminate incorrectly.

.NET DELEGATES
It’s a way to declare a function like in a Interface to implement it (for example) later in a class and
create an instance to that class passing as a PARAM the function.

.NET SERIALIZATION
The process of converting the state of an object instance to a stream of data

SEALED CLASS
Can’t be inherited.

VIRTUAL
They can be overridden in the child class

STATIC CLASS
Is stored once no matter how many instance of the class we create.

ENUM
Enumeration list declaration (Set of const).
Default modifiers as Public.

GENERICS
Create collection classes.

IS
Check compatibility of an object. Returns Boolean

AS
Used for casting of object to a type or a class.
GENERAL
FORM
A representation of a window displayed in an application

CONTROL
Component that provides a UI capabilities

DESIGN PATTERN
There are common solutions to common design problems.
MVC: Model View Controller
MVP: Model View Presenter
MVVM: Model-View-View Model

STACK & HEAP


Stack: place in memory where value types are stored
Heap: place in memory where reference types are
stored
SSIS, SSAS, SSRS

SQL Server Integration Services (SSIS)


A component of SQL Server, which can be used to perform a wide range of Data Migration and ETL
operations.

SQL Server Analysis Services (SSAS)


Provides interactive data visualization and search-based data discovery solutions.

SQL Server Reporting Services (SSRS)


Provides the ability to create highly formatted, print-ready and interactive reports and
dashboards.
SQL
PRIMARY KEY
Unique identifier for a row in a table. Used to enforce entity integrity.

FOREIGN KEY
Prevents actions that would destroy links and values between tables

IDENTITY
AutoNumber field

VIEW
Virtual table based on the result-set of an SQL statement

INNER JOIN
Displays only the rows that have a match in both joined tables

LEFT JOIN
Returns all rows from the left table, with the matching rows in the right table

RIGHT JOIN
Returns all rows from the right table, with the matching rows in the left table.

FULL JOIN
Returns all rows from the left table (table1) and from the right table (table2)
FUNCTIONS (UDF) VS STORE PROCEDURE
UDF can be used in the SQL statements anywhere in the WHERE / HAVING / SELECT.
UDFs that return tables can be treated as another rowset.
This can be used in JOINs with other tables.

TRIGGER
A database trigger is procedural code that is automatically executed in response to certain events on
a particular table or view in a database.
The trigger is mostly used for maintaining the integrity of the information on the database.
For example, when a new record (representing a new worker) is added to the employees table, new
records should also be created in the tables of the taxes, vacations and salaries.

MVC
Architecture pattern Model (DB), View (UI), Controller (BL).
Simplest syntax, code length reduced.
The 3 components are Model, View and the Controller.
It’s defined in the System.Web.Mvc assembly

RAZOR
View engine process .aspx, .cshtml files

CONTROLLER
A class extended from controller class and contains the differnt ActionResults needed for an specific
View (HomeController has Home's Views action results).
Its role is responds to user interactions

VIEW
View folder contains html files related with the UI (html, asp, aspx, cshtml, and vbhtml).
Its accessed from the server through a browser request using {controller}\{Action}\{parameter}

ACTION
A method inside the Controller that return an ActionResult value.
Default method is a GET, to turns it into a POST, is needed the [HttpPost] attribute.
Can be ViewResult, JavaScriptResult, RedirectResult, ContentResult, JsonResult.

ACTIONRESULT
Add a simple method inside a controller class with ActionResult return type.
HTML HELPER
@Html object. Its functions returns a string.
@Html.EditorFor(model => model.LastName)

TEMPDATE, VIEWDATA, VIEWBAG


TempDate: transfer data from controller-controller, action-action. On redirect, “TempData” helps to
maintain data between those redirects
ViewData: Keeps data between controller-view
ViewBag: Dynamic wrapper around View data. type casting is not required (uses internal dynamic
keyword)

PARTIAL VIEW
reusable view (like a user control), can be embedded inside other view.
<% Html.RenderPartial("MyView"); %>

VALIDATIONS
Can be done using data annotations
Data Annotations
Attributes which you can be applied on the model properties.
[Required(ErrorMessage = "Required")]

DATA ANNOTATIONS
Attributes which you can be applied on the model properties.
[Required(ErrorMessage = "Required")]

ROUTING RULES
App_Start/RouteConfig.
Maps incoming browser requests to controller action methods
WCF
WCF
Framework that permits us to send data as asynchronous messages from one service endpoint to
another though different kind of protocols.

The ABC is
A: Address (is the Where) B: Binding (is the How) C: Contract (is the What)

MAIN COMPONENTS

Service
The working logic or offering, implemented using any .Net Language

Host
The environment where the service is parked. E.g. exe, process, windows service.

Endpoints
The way a service is exposed to outside world.

ADDRESS
A way of letting client know that where a service is located.

SERVICE
Is a class can contain one or more methods that are exposed through the WCF service.
Can have one or more endpoints.

ENDPOINT
Interface which defines how a client will communicate with the service.
CONTRACTS

Service Contracts
Describe which operations the client can perform on the service.

Data Contracts
Define which data types are passed to and from the service (Implicit: int, string).

Fault Contracts
Define which errors are raised by the service and how handle and propagate to clients.

Message Contracts
Allow the service to interact directly with messages. Message contracts can be typed or untyped,
and are useful in interoperability cases and when there is an existing message format we have to
comply with.

BINDING
Defines how an endpoint communicates to the world.
Defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary).
WEB
ASPX WEBSERVICE
WCF replaces ASMX web services.
ASMX Web services can only be invoked by HTTP and it lives only in the IIS while WCF can any
protocol (New version, new EndPoint, more flexibility)

SOAP
Simple Access Object Protocol.
It was like a standards-based Web services access protocol.
Relies exclusively on XML to provide messaging services.

REST
Instead of using XMLlike SOAP to make a request, REST relies on a simple URL in many cases.
It doesn’t have to use XML to provide the response. REST-based Web services that output the data in
Command Separated Value (CSV), JavaScript Object Notation (JSON) and Really Simple Syndication
(RSS).

HTML
HyperText Markup Language: the language that browsers use to display a web page.

XHTML
Extensible Hypertext Markup Language
HTML rewritten with XML rules (is HTML written as XML)
Why? Many pages on the internet contain "bad" HTML.

HTML
<b><i>This text is bold and italic</b></i>

XHTML
<b><i>This text is bold and italic</i></b>
CSS
Cascading Style Sheets
The language to layout web pages in the browser.

p {
text-align: left;
}

#idname {
color: red;
}

.classname {
text-align: center;
}

CSS BOX MODEL


The model on which the dimensions of elements are calculated with
regard to height, width, padding, border, and margin.

CSS SELECTORS
Are used to "find" elements in the HTML based on their id, class, type, etc.

.intro {
background-color: yellow;
}

<div class="intro">
<p>My name is Donald.</p>
</div>

JAVASCRIPT
A programming language used to interact with a
web page in the client’s Browser.

AJAX
Asynchronous JavaScript and XML, a term for a
collection of techniques used to create flicker-
free web pages and to interact with the server
from client-side code.
JQUERY

A popular client-side JavaScript framework that simplifies working with the DOM, visual effects,
event handling and Ajax functionality.

jQuery OnLoad
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});

jQuery Selectors
$("p").hide(), $("#test").hide()
$(".test").hide()
$(this).hide()

jQuery Events
click(), dblclick(), mouseenter(), mouseleave(), mousedown(), mouseup(), hover(), focus() & blur()

APPLICATION SERVER
Software engine that delivers application to client computers. runs in the server.
IIS is the Microsoft Application Server

JSON
JavaScript Object Notation
Is a lightweight data-interchange format.

ASP.NET WEB FORMS


All server controls must appear within a <form> tag, and the <form> tag must contain the
runat="server" attribute.

Form
<form runat="server">
...HTML + server controls
</form>

Submitting a Form
<asp:Button id="id" text="label" OnClick="sub" runat="server" />
HTML5
Is like HTML with a new set of API
Geolocation (navigator.geolocation.getCurrentPosition)
Drag and Drop,
Local Storage Secure & large data storage
localStorage.setItem("lastname", "Smith”) ),

Application Cache (Offline browsing, Speed, Reduced server load)


<html manifest="demo.appcache">

Web Workers (script exec background)


w = new Worker(“w.js");

SSE: Server-Sent Events (web automatically gets updates from server)


var w = new EventSource(“w.php");

Вам также может понравиться