Sunteți pe pagina 1din 62

ASP.

NET
ASP.NET is an open source[1] server-side Web application framework designed for Web
development to produce dynamic Web pages. It was developed by Microsoft to allow
programmers to build dynamic web sites, web applications and web services.
It was first released in January 2002 with version 1.0 of the .NET Framework, and is the
successor to Microsoft's Active Server Pages(ASP) technology. ASP.NET is built on the
Common Language Runtime (CLR), allowing programmers to write ASP.NET code
using any supported .NET language. The ASP.NET SOAP extension framework allows
ASP.NET components to process SOAP messages.
ASP.NET is in the process of being re-implemented as a modern and modular web
framework, together with other frameworks likeEntity Framework. The new framework
will make use of the new open-source .NET Compiler Platform (Code-name "Roslyn")
and becross platform. The project is called "ASP.NET vNext".
History[edit]
After four years of development, and a series of beta releases in 2000 and 2001,
ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET
Framework. Even prior to the release, dozens of books had been written about ASP.NET,
[2] and Microsoft promoted it heavily as part of its platform for Web services. Scott
Guthrie became the product unit manager for ASP.NET, and development continued
apace, with version 1.1 being released on April 24, 2003 as a part of Windows Server
2003. ASP.NET is loosely based on HTML. This release focused on improving
ASP.NET's support for mobile devices.
Characteristics[edit]
ASP.NET Web pages, known officially as Web Forms,[3] are the main building blocks for
application development.[4] Web forms are contained in files with a ".aspx" extension;
these files typically contain static (X)HTML markup, as well as markup defining serverside Web Controls and User Controls where the developers place all the rc content[further
explanation needed] for the Web page. Additionally, dynamic code which runs on the
server can be placed in a page within a block <% -- dynamic code -- %>, which is similar
to other Web development technologies such as PHP, JSP, and ASP. With ASP.NET
Framework 2.0, Microsoft introduced a new code-behind model which allows static text
to remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs or
.aspx.fs file (depending on the programming language used).[5]
Directives[edit]
A directive is a special instruction on how ASP.NET should process the page.[6] The

most common directive is <%@ Page %> which can specify many attributes used by the
ASP.NET page parser and compiler.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="On"/>
</system.web>
</configuration>
User controls[edit]
User controls are encapsulations of sections of pages which are registered and used as
controls in ASP.NET, org,etc.
Custom controls[edit]
Programmers can also build custom controls for ASP.NET applications. Unlike user
controls, these controls do not have an ASCX markup file, having all their code compiled
into adynamic link library (DLL) file. Such custom controls can be used across multiple
Web applications and Visual Studio projects.
Rendering technique[edit]
ASP.NET uses a "visited composites" rendering technique. During compilation, the
template (.aspx) file is compiled into initialization code which builds a control tree (the
composite) representing the original template. Literal text goes into instances of the
Literal control class, and server controls are represented by instances of a specific control
class. The initialization code is combined with user-written code (usually by the assembly
of multiple partial classes) and results in a class specific for the page. The page doubles
as the root of the control tree.
Actual requests for the page are processed through a number of steps. First, during the
initialization steps, an instance of the page class is created and the initialization code is
executed. This produces the initial control tree which is now typically manipulated by the
methods of the page in the following steps. As each node in the tree is a control
represented as an instance of a class, the code may change the tree structure as well as
manipulate the properties/methods of the individual nodes. Finally, during the rendering
step a visitor is used to visit every node in the tree, asking each node to render itself using
the methods of the visitor. The resulting HTML output is sent to the client.
After the request has been processed, the instance of the page class is discarded and with
it the entire control tree. This is a source of confusion among novice ASP.NET
programmers who rely on the class instance members that are lost with every page

request/response cycle.
State management[edit]
ASP.NET applications are hosted by a Web server and are accessed using the stateless
HTTP protocol. As such, if an application uses stateful interaction, it has to implement
state management on its own. ASP.NET provides various functions for state management.
Conceptually, Microsoft treats "state" as GUI state. Problems may arise if an application
needs to keep track of "data state"; for example, a finite-state machine which may be in a
transient state between requests (lazy evaluation) or which takes a long time to initialize.
State management in ASP.NET pages with authentication can make Web scraping
difficult or impossible.
Application[edit]
Application state is held by a collection of shared user-defined variables. These are set
and initialized when the Application_OnStart event fires on the loading of the first
instance of the application and are available until the last instance exits. Application state
variables are accessed using the Applications collection, which provides a wrapper for the
application state. Application state variables are identified by name.[7] Application is
state management.
Session state[edit]
Server-side session state is held by a collection of user-defined session variables that are
persistent during a user session. These variables, accessed using the Sessioncollection, are
unique to each session instance. The variables can be set to be automatically destroyed
after a defined time of inactivity even if the session does not end. Client-side user session
is maintained by either a cookie or by encoding the session ID in the URL itself.[7]
ASP.NET supports three modes of persistence for server-side session variables:[7]
In-process mode
The session variables are maintained within the ASP.NET process. This is the fastest
way; however, in this mode the variables are destroyed when the ASP.NET process is
recycled or shut down.
State server mode
ASP.NET runs a separate Windows service that maintains the state variables. Because
state management happens outside the ASP.NET process, and because the ASP.NET
engine accesses data using .NET Remoting, ASPState is slower than In-Process. This
mode allows an ASP.NET application to be load-balanced and scaled across multiple
servers. Because the state management service runs independently of ASP.NET, the
session variables can persist across ASP.NET process shutdowns. However, since
session state server runs as one instance, it is still one point of failure for session state.
The session-state service cannot be load-balanced, and there are restrictions on types
that can be stored in a session variable.

SQL Server mode


State variables are stored in a database, allowing session variables to be persisted
across ASP.NET process shutdowns. The main advantage of this mode is that it
allows the application to balance load on a server cluster, sharing sessions between
servers. This is the slowest method of session state management in ASP.NET.
ASP.NET session state enables you to store and retrieve values for a user as the user
navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means
that a Web server treats each HTTP request for a page as an independent request. The
server retains no knowledge of variable values that were used during previous requests.
ASP.NET session state identifies requests from the same browser during a limited time
window as a session, and provides a way to persist variable values for the duration of that
session. By default, ASP.NET session state is enabled for all ASP.NET applications.
Alternatives to session state include the following:
Application state, which stores variables that can be accessed by all users of an
ASP.NET application.
Profile properties, which persists user values in a data store without expiring
them.
ASP.NET caching, which stores values in memory that is available to all
ASP.NET applications.
View state, which persists values in a page.
Cookies.
The query string and fields on an HTML form that are available from an HTTP
request.
For a comparison of different state-management options, see ASP.NET State
Management Recommendations Session
View state[edit]
View state refers to the page-level state management mechanism, utilized by the HTML
pages emitted by ASP.NET applications to maintain the state of the Web form controls
andwidgets. The state of the controls is encoded and sent to the server at every form
submission in a hidden field known as __VIEWSTATE. The server sends back the
variable so that, when the page is re-rendered, the controls render at their last state. At the
server side, the application may change the viewstate, if the processing requires a change
of state of any control. The states of individual controls are decoded at the server, and are
available for use in ASP.NET pages using the ViewState collection.[8] [9]
The main use for this is to preserve form information across postbacks. View state is
turned on by default and normally serializes the data in every control on the page

regardless of whether it is actually used during a postback. This behavior can (and
should) be modified, however, as View state can be disabled on a per-control, per-page,
or server-wide basis.
Developers need to be wary of storing sensitive or private information in the View state
of a page or control, as the base64 string containing the view state data can easily be deserialized. By default, View state does not encrypt the __VIEWSTATE value. Encryption
can be enabled on a server-wide (and server-specific) basis, allowing for a certain level of
security to be maintained.[10]
Server-side caching[edit]
ASP.NET offers a "Cache" object that is shared across the application and can also be
used to store various objects. The "Cache" object holds the data only for a specified
amount of time and is automatically cleaned after the session time-limit elapses.
Other[edit]
Other means of state management that are supported by ASP.NET are cookies, caching,
and using the query string.
Template engine[edit]
When first released, ASP.NET lacked a template engine. Because the .NET Framework is
object-oriented and allows for inheritance, many developers would define a new base
class that inherits from "System.Web.UI.Page", write methods there that render HTML,
and then make the pages in their application inherit from this new class. While this allows
for common elements to be reused across a site, it adds complexity and mixes source
code with markup. Furthermore, this method can only be visually tested by running the
application not while designing it. Other developers have used include files and other
tricks to avoid having to implement the same navigation and other elements in every
page.
ASP.NET 2.0 introduced the concept of "master pages", which allow for template-based
page development. A Web application can have one or more master pages, which,
beginning with ASP.NET 2.0, can be nested.[11] Master templates have place-holder
controls, called ContentPlaceHolders to denote where the dynamic content goes, as well
asHTML and JavaScript shared across child pages.
Child pages use those ContentPlaceHolder controls, which must be mapped to the placeholder of the master page that the content page is populating. The rest of the page is
defined by the shared parts of the master page, much like a mail merge in a word
processor. All markup and server controls in the content page must be placed within the
ContentPlaceHolder control.

When a request is made for a content page, ASP.NET merges the output of the content
page with the output of the master page, and sends the output to the user.
The master page remains fully accessible to the content page. This means that the content
page may still manipulate headers, change title, configure caching etc. If the master page
exposes public properties or methods (e.g. for setting copyright notices) the content page
can use these as well.
Other files[edit]

Extensio
n

Introduced in
version

Description

asax

1.0

This is the global application file.You can use this


file to define global variables (Variable that can be
accessed from any Web page in the Web application.)
It is mostly used to define the overall application
event related to application & session
object.Global.asax, used for application-level logic
[12]

ascx

1.0

User Control, used for User Control files logic [13]

ashx

1.0

custom HTTP handlers Do not have a user interface.

asmx

1.0

Web service pages. From version 2.0 a Code behind


page of an asmx file is placed into the app_code
folder.

1.0

An ASP.NET Web Forms page that can contain Web


controls and presentation and business logic.
http://msdn.microsoft.com/enus/library/2wawkw1c.aspx

1.0

when enabled in web.config requesting trace.axd


outputs application-level tracing. Also used for the
special webresource.axd handler which allows
control/component developers to package a
component/control complete with images, script, css
etc. for deployment in one file (an 'assembly')

2.0

browser capabilities files stored in XML format;


introduced in version 2.0. ASP.NET 2 includes many
of these by default, to support common Web
browsers. These specify which browsers have which
abilities, so that ASP.NET 2 can automatically
customize and optimize its output accordingly.
Special .browser files are available for free download
to handle, for instance, the W3C Validator, so that it
properly shows standards-compliant pages as being
standards-compliant. Replaces the harder-to-use
BrowserCaps section that was in machine.config and
could be overridden in web.config in ASP.NET 1.x.

1.0

web.config is the only file in a specific Web


application to use this extension by default
(machine.config similarly affects the entire Web
server and all applications on it), however ASP.NET
provides facilities to create and consume other config
files. These are stored in XML format.

cs/vb/fs

1.0

Code files (cs indicates C#, vb indicates Visual


Basic, fs indicates F#). Code behind files (see above)
predominantly have the extension ".aspx.cs" or
".aspx.vb" for the two most common languages.
Other code files (often containing common "library"
classes) can also exist in the Web folders with the
cs/vb extension. In ASP.NET 2 these should be
placed inside the App_Code folder where they are
dynamically compiled and available to the whole
application.

cshtml

4.1

Views (mixed C# and HTML using Razor syntax)

aspx

axd

browser

config

Other file extensions associated with different versions of ASP.NET include:


Directory structure[edit]
In general, the ASP.NET directory structure can be determined by the developer's
preferences. Apart from a few reserved directory names, the site can span any number of
directories. The structure is typically reflected directly in the URLs. Although ASP.NET
provides means for intercepting the request at any point during processing, the developer
is not forced to funnel requests through a central application or front controller.
The special directory names (from ASP.NET 2.0 on) are:[14]
App_Code
This is the "raw code" directory. The ASP.NET server automatically compiles files
(and subdirectories) in this folder into an assembly which is accessible in the code of
every page of the site. App_Code will typically be used for data access abstraction
code, model code and business code. Also any site-specific http handlers and modules
and Web service implementation go in this directory. As an alternative to using
App_Code the developer may opt to provide a separate assembly with precompiled
code.
App_Data
The App_Data ASP.NET Directory is the default directory for any database used by
the ASP.NET Website. These databases might include Access (mdb) files or SQL
Server(mdf) files. The App_Data is the only directory with Write Access enabled for
the ASP.NET web application.:[15]
App_LocalResources
E.g. a file called CheckOut.aspx.fr-FR.resx holds localized resources for the French
version of the CheckOut.aspx page. When the UI culture is set to French, ASP.NET
will automatically find and use this file for localization.
App_GlobalResources
Holds resx files with localized resources available to every page of the site. This is
where the ASP.NET developer will typically store localized messages etc. which are
used on more than one page.
App_Themes
Adds a folder that holds files related to themes which is a new ASP.NET feature that
helps ensure a consistent appearance throughout a Web site and makes it easier to
change the Web sites appearance when necessary.
App_WebReferences
holds discovery files and WSDL files for references to Web services to be consumed
in the site.
Bin
Contains compiled code (.dll files) for controls, components, or other code that you
want to reference in your application. Any classes represented by code in the Bin
folder are automatically referenced in your application.

Performance[edit]
ASP.NET aims for performance benefits over other script-based technologies (including
classic ASP) by compiling the server-side code the first time it is used to one or more
DLLfiles on the Web server. These dll files or assemblies contain Microsoft Intermediate
Language (MSIL) for running within the common language runtime; this provides a
performance boost over pure scripted languages and is similar to the approach used by
Python and not dissimilar to java server pages.[16] This compilation happens
automatically the first time a page is requested (which means the developer need not
perform a separate compilation step for pages).
This feature provides the ease of development offered by scripting languages with the
performance benefits of a compiled binary. However, the compilation might cause a
noticeable but short delay to the Web user when the newly edited page is first requested
from the Web server, but will not again unless the page requested is updated further.
The ASPX and other resource files are placed in a virtual host on an Internet Information
Services server (or other compatible ASP.NET servers; see Other implementations,
below). The first time a client requests a page, the .NET Framework parses and compiles
the file(s) into a .NET assembly and sends the response; subsequent requests are served
from the DLL files. By default ASP.NET will compile the entire site in batches of 1000
files upon first request. If the compilation delay is causing problems, the batch size or the
compilation strategy may be tweaked.
Developers can also choose to pre-compile their "codebehind" files before deployment,
using Microsoft Visual Studio, eliminating the need for just-in-time compilation in a
production environment.[citation needed] This also eliminates the need of having the
source code on the Web server. It also supports pre-compile text.
Extension[edit]
Microsoft has released some extension frameworks that plug into ASP.NET and extend its
functionality. Some of them are:
ASP.NET AJAX
An extension with both client-side as well as server-side components for writing
ASP.NET pages that incorporate AJAX functionality.
ASP.NET MVC Framework
An extension to author ASP.NET pages using the modelviewcontroller (MVC)
architecture.
ASP.NET Razor view engine
An alternative view to Web Forms designed for use with MVC since release 3.
ASP.NET Dynamic Data
A scaffolding extension to build data driven web applications

ASP.NET Web API


An HTTP API framework for exposing web services.
ASP.NET SignalR
A real-time communications framework for bi-directional communication between
client and server.
ASP.NET compared with classic ASP[edit]
ASP.NET simplifies developers' transition from Windows application development to
Web development by offering the ability to build pages composed of controls similar to a
Windows user interface. A Web control, such as a button or label, functions in very much
the same way as its Windows counterparts: code can assign its properties and respond to
its events. Controls know how to render themselves: whereas Windows controls draw
themselves to the screen, Web controls produce segments of HTML and JavaScript which
form parts of the resulting page sent to the end-user's browser.
ASP.NET encourages the programmer to develop applications using an event-driven GUI
model, rather than in conventional Web-scripting environments like ASP and PHP. The
framework combines existing technologies such as JavaScript with internal components
like "ViewState" to bring persistent (inter-request) state to the inherently stateless Web
environment.
Other differences compared to classic ASP are:
Compiled code means applications run faster with more design-time errors
trapped at the development stage.
Significantly improved run-time error handling, making use of exception handling
using try-catch blocks.
Similar metaphors to Microsoft Windows applications such as controls and
events.
An extensive set of controls and class libraries, as well as user-defined controls,
allow the rapid building of applications. Layout of these controls on a page is easier
because most of it can be done visually in most editors.
ASP.NET uses the multi-language abilities of the .NET Common Language
Runtime, allowing Web pages to be coded in VB.NET, C#, J#, Delphi.NET, Chrome,
etc.
Ability to cache the whole page or just parts of it to improve performance.
Ability to use the code-behind development model to separate business logic from
presentation.
Ability to use true object-oriented design for programming pages and controls
If an ASP.NET application leaks memory, the ASP.NET runtime unloads the

AppDomain hosting the erring application and reloads the application in a new
AppDomain.
Session state in ASP.NET can be saved in a Microsoft SQL Server database or in a
separate process running on the same machine as the Web server or on a different
machine. That way session values are not lost when the Web server is reset or the
ASP.NET worker process is recycled.
Versions of ASP.NET prior to 2.0 were criticized for their lack of standards
compliance. The generated HTML and JavaScript sent to the client browser would not
always validate against W3C/ECMA standards. In addition, the framework's browser
detection feature sometimes incorrectly identified Web browsers other than
Microsoft's own Internet Explorer as "downlevel" and returned HTML/JavaScript to
these clients with some of the features removed, or sometimes crippled or broken. In
version 2.0 however, all controls generate valid HTML 4.0, XHTML 1.0 (the default)
or XHTML 1.1 output, depending on the site configuration. Detection of standardscompliant Web browsers is more robust and support for Cascading Style Sheets is
more extensive.
Web Server Controls: these are controls introduced by ASP.NET for providing the
UI for the Web form. These controls are state managed controls and are WYSIWYG
controls.
Criticism[edit]
On IIS 6.0 and lower, pages written using different versions of the ASP framework cannot
share session state without the use of third-party libraries. This criticism does not apply to
ASP.NET and ASP applications running side by side on IIS 7. With IIS 7.0, modules may
be run in an integrated pipeline that allows modules written in any language to be
executed for any request.[17]
Development tools[edit]
Several available software packages exist for developing ASP.NET applications:
Software

Developer

Licensing

ASP.NET Intellisense
Generator [2]

BlueVision LLC

Free

Microsoft Visual Studio

Microsoft

Free and commercial

Microsoft Visual Web


Developer Express

Microsoft

Registerware

CodeGear Delphi

Embarcadero Technologies

Commercial

Macromedia HomeSite

Adobe Systems

Commercial

Microsoft Expression Web

Microsoft

Free

Microsoft SharePoint
Designer

Microsoft

Free

MonoDevelop

Novell and the Mono


community

Free open source

SharpDevelop

ICSharpCode Team

Free open source

Eiffel for ASP.NET [3]

Eiffel Software

Free open source and


commercial

Adobe Dreamweaver

Adobe Systems

Commercial

Frameworks[edit]
It is not essential to use the standard Web forms development model when developing
with ASP.NET. Noteworthy frameworks designed for the platform include:
Base One Foundation Component Library (BFC) is a RAD framework for
building .NET database and distributed computing applications.
DotNetNuke is an open-source solution which comprises both a web application
framework and a content management system which allows for advanced
extensibility through modules, skins, and providers.
Castle MonoRail, an open-source MVC framework with an execution model
similar to Ruby on Rails. The framework is commonly used with Castle
ActiveRecord, an ORM layer built on NHibernate.
Spring.NET , a port of the Spring framework for Java.
Survey Project is an open-source web-based survey and form engine framework
written in ASP.NET and C#.
Carbon MVVM is an open-source MVVM framework based on ASP.NET
Versions[edit]
The ASP.NET releases history tightly correlates with the .NET Framework releases:
Date

Versio
n

January 16, 2002 1.0

Remarks
First version
released together
with Visual
Studio .NET

New ASP.NET related features


Object-oriented Web application
development supporting inheritance,
polymorphismand other standard
OOP features
Developers are no longer
forced to use
Server.CreateObject(...), so
early-binding and type safety

are possible.
Based on Windows
programming; the developer can
make use of DLL class libraries and
other features of the Web server to
build more robust applications that
do more than simply rendering
HTML (e.g. exception handling)

April 24, 2003

November 7,
2005

November 21,
2006

1.1

2.0

3.0

released together
with Windows
Server 2003
released together
with Visual
Studio .NET
2003

codename
Whidbey
released together
with Visual
Studio 2005 and
Visual Web
Developer
Express
and SQL Server
2005

Mobile controls
Automatic input validation

New data controls (GridView,


FormView, DetailsView)
New technique for declarative
data access (SqlDataSource,
ObjectDataSource, XmlDataSource
controls)
Navigation controls
Master pages
Login controls
Themes
Skins
Web parts
Personalization services
Full pre-compilation
New localization technique
Support for 64-bit processors
Provider class model
Windows Presentation
Foundation (WPF)
Windows Workflow Foundation
(WF)
Windows Communication
Foundation which can use ASP.NET
to host services.
Windows CardSpace which uses

ASP.NET for login roles.

November 19,
2007

3.5

Released with
Visual Studio
2008 and
Windows Server
2008

3.5
August 11, 2008 Service
Pack 1

Released with
Visual Studio
2008 Service
Pack 1

April 12, 2010

Parallel
extensions and
other .NET
Framework 4
features

4.0

August 15, 2012 4.5

Released with
Visual Studio
2012 and
Windows Server
2012 for
Windows 8
Parallel
extensions and
other .NET
Framework

New data controls (ListView,


DataPager)
ASP.NET AJAX included as part
of the framework
Support for HTTP pipelining and
syndication feeds.
WCF support for RSS, JSON,
POX and Partial Trust
All the .NET Framework 3.5
changes, like LINQ etc.
Incorporation of ASP.NET
Dynamic Data
Support for controlling browser
history in an ASP.NET AJAX
application
Ability to combine multiple
JavaScript files into one file for
more efficient downloading
New namespaces
System.Web.Abstractions and
System.Web.Routing

The two new properties added in the


Page class are MetaKeyword and
MetaDescription.

4.5features
Legend:
Old version
Older version, still supported
Latest version
Future release

Other implementations[edit]
The Mono Project supports "everything in .NET 4.5 except WPF, WF, limited WCF, and
limited ASP.NET 4.5 async stack."[18] ASP.NET can be run with Mono using one of
three options: Apache hosting using the mod_mono module, FastCGI hosting, and XSP.

C Sharp (programming language)

C#[note 2] (pronounced as see sharp) is a multi-paradigm programming language


encompassing strong typing, imperative, declarative,functional, generic, object-oriented
(class-based), and component-oriented programming disciplines. It was developed by
Microsoftwithin its .NET initiative and later approved as a standard by Ecma (ECMA334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed
for the Common Language Infrastructure.
C# is intended to be a simple, modern, general-purpose, object-oriented programming
language.[7] Its development team is led byAnders Hejlsberg. The most recent version is
C# 5.0, which was released on August 15, 2012.
Boxing and unboxing[edit]
Boxing is the operation of converting a value-type object into a value of a corresponding
reference type.[42] Boxing in C# is implicit.
Unboxing is the operation of converting a value of a reference type (previously boxed)
into a value of a value type.[42] Unboxing in C# requires an explicit type cast. A boxed
object of type T can only be unboxed to a T (or a nullable T).[43]
Example:
int foo1 = 42;
// Value type.
object bar = foo1; // foo is boxed to bar.
int foo2 = (int)bar; // Unboxed back to value type.
Generics[edit]
Generics were added to version 2.0 of the C# language. Generics use type parameters,
which make it possible to design classes and methods that do not specify the type used
until the class or method is instantiated. The main advantage is that one can use generic
type parameters to create classes and methods that can be used without incurring the cost
of runtime casts or boxing operations, as shown here:[44]
// Declare the generic class.
public class GenericList<T>
{
void Add(T input) { }
}
class TestGenericList
{
private class ExampleClass { }
static void Main()
{
// Declare a list of type int.

GenericList<int> list1 = new GenericList<int>();


// Declare a list of type string.
GenericList<string> list2 = new GenericList<string>();
// Declare a list of type ExampleClass.
GenericList<ExampleClass> list3 = new GenericList<ExampleClass>();
}
}
When compared with C++ templates, C# generics can provide enhanced safety, but also
have somewhat limited capabilities.[45] For example, it is not possible to call arithmetic
operators on a C# generic type.[46]
Preprocessor[edit]
C# features "preprocessor directives"[47] (though it does not have an actual preprocessor)
based on the C preprocessor that allow programmers to define symbols, but not macros.
Conditionals such as #if, #endif, and #else are also provided. Directives such as #region
give hints to editors for code folding.
public class Foo
{
#region Constructors
public Foo() {}
public Foo(int firstParam) {}
#endregion
#region Procedures
public void IntBar(int firstParam) {}
public void StrBar(string firstParam) {}
public void BoolBar(bool firstParam) {}
#endregion
}
Code comments[edit]
C# utilizes a double slash (//) to indicate the rest of the line is a comment. This is
inherited from C++.
public class Foo
{
// a comment
public static void Bar(int firstParam) {} // also a comment
}

Multi-line comments can start with slash-asterisk (/*) and end asterisk-slash (*/). This is
inherited from standard C.
public class Foo
{
/* A Multi-Line
comment */
public static void Bar(int firstParam) {}
}
XML documentation system[edit]
C#'s documentation system is similar to Java's Javadoc, but based on XML. Two methods
of documentation are currently supported by the C# compiler.
Single-line documentation comments, such as those commonly found in Visual Studio
generated code, are indicated on a line beginning with ///.
public class Foo
{
/// <summary>A summary of the method.</summary>
/// <param name="firstParam">A description of the parameter.</param>
/// <remarks>Remarks about the method.</remarks>
public static void Bar(int firstParam) {}
}
Multi-line documentation comments, while defined in the version 1.0 language
specification, were not supported until the .NET 1.1 release.[48] These comments start
with slash-asterisk-asterisk (/**) and end asterisk-slash (*/).[49]
public class Foo
{
/** <summary>A summary of the method.</summary>
* <param name="firstParam">A description of the parameter.</param>
* <remarks>Remarks about the method.</remarks> */
public static void Bar(int firstParam) {}
}
Note there are some stringent criteria regarding white space and XML documentation
when using the slash/asterisk/asterisk (/**) technique.
This code block:
/**
* <summary>
* A summary of the method.</summary>*/

produces a different XML comment from this code block:[49]


/**
* <summary>
A summary of the method.</summary>*/
Syntax for documentation comments and their XML markup is defined in a nonnormative annex of the ECMA C# standard. The same standard also defines rules for
processing of such comments, and their transformation to a plain XML document with
precise rules for mapping of CLI identifiers to their related documentation elements. This
allows any C# IDEor other development tool to find documentation for any symbol in the
code in a certain well-defined way.
Libraries[edit]
The C# specification details a minimum set of types and class libraries that the compiler
expects to have available. In practice, C# is most often used with some implementation of
the Common Language Infrastructure (CLI), which is standardized as ECMA-335
Common Language Infrastructure (CLI).
"Hello, world" example[edit]
The following is a very simple C# program, a version of the classic "Hello world"
example:
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, world!");
}
}
The effect is to write the following text to the output console:
Hello, world!
Each line has a purpose:
using System;
The above line of code tells the compiler to use System as a candidate prefix for types
used in the source code. In this case, when the compiler sees use of the Console type later

in the source code, it tries to find a type named Console, first in the current assembly,
followed by all referenced assemblies. In this case the compiler fails to find such a type,
since the name of the type is actually System.Console. The compiler then attempts to find
a type named System.Console by using the System prefix from the usingstatement, and
this time it succeeds. The using statement allows the programmer to state all candidate
prefixes to use during compilation instead of always using full type names.
class Program
Above is a class definition. Everything between the following pair of braces describes
Program.
static void Main()
This declares the class member method where the program begins execution. The .NET
runtime calls the Main method. (Note: Main may also be called from elsewhere, like any
other method, e.g. from another method of Program.) The static keyword makes the
method accessible without an instance of Program. Each console application's Main entry
point must be declared static. Otherwise, the program would require an instance, but any
instance would require a program. To avoid that irresolvable circular dependency, C#
compilers processing console applications (like that above) report an error, if there is no
static Main method. The void keyword declares that Main has no return value.
Console.WriteLine("Hello, world!");
This line writes the output. Console is a static class in the System namespace. It provides
an interface to the standard input, output, and error streams for console applications. The
program calls the Console method WriteLine, which displays on the console a line with
the argument, the string "Hello world!".
A GUI example:
using System.Windows.Forms;
class Program
{
static void Main()
{
MessageBox.Show("Hello, world!");
}
}
This example is similar to the previous example, except that it generates a dialog box that

contains the message "Hello, world!" instead of writing it to the console.

JSON
JSON (/desn/ JAY-sn),[1] or JavaScript Object Notation, is an open standard format
that uses human-readable text to transmit data objects consisting of attributevalue pairs.
It is used primarily to transmit data between a server and web application, as an
alternative to XML.
Although originally derived from the JavaScript scripting language, JSON is a language-

independent data format. Code for parsing and generating JSON data is readily available
in a large variety of programming languages.
The JSON format was originally specified by Douglas Crockford. It is currently
described by two competing standards, RFC 7159 and ECMA-404. The ECMA
standard is minimal, describing only the allowed grammar syntax, whereas the RFC also
provides some semantic and security considerations.[2] The official Internet media type
for JSON is application/json. The JSON filename extension is .json.
Data types, syntax and example[edit]
JSON's basic types are:
Number a signed decimal number that may contain a fractional part and may
use exponential E notation. JSON does not allow non-numbers like NaN, nor does it
make any distinction between integer and floating-point. (Even though JavaScript
uses a double-precision floating-point format for all its numeric values, other
languages implementing JSON may encode numbers differently)
String a sequence of zero or more Unicode characters, though characters
outside the BMP must be represented as a surrogate pair. Strings are delimited with
double-quotation marks and support a backslash escaping syntax.
Boolean either of the values true or false
Array an ordered list of zero or more values, each of which may be of any
type. Arrays use square bracket notation with elements being comma-separated.
Object an unordered associative array (name/value pairs). Objects are
delimited with curly brackets and use commas to separate each pair, while within
each pair the colon ':' character separates the key or name from its value. All keys
must be strings and should be distinct from each other within that object.
null An empty value, using the word null
JSON generally ignores any whitespace around or between syntactic elements (values
and punctuation, but not within a string value). However JSON only recognizes four
specific whitespace characters: the space, horizontal tab, line feed, and carriage return.
JSON does not provide or allow any sort of comment syntax.
Early versions of JSON (such as specified by RFC 4627 ) required that a valid JSON
"document" must consist of only an object or an array typethough they could contain
other types within them. This restriction was relaxed starting with RFC 7158 , so that a
JSON document may consist entirely of any possible JSON typed value.
The following example shows a possible JSON representation describing a person.
{

"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 25,
"height_cm": 167.6,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
}
],
"children": [],
"spouse": null
}

Ajax (programming)
Ajax (also AJAX; /edks/; short for asynchronous JavaScript + XML)[1][2][3] is a
group of interrelated Web development techniques used on the client-side to
createasynchronous Web applications. With Ajax, Web applications can send data to, and
retrieve data from, a server asynchronously (in the background) without interfering with
the display and behavior of the existing page. Data can be retrieved using the
XMLHttpRequest object. Despite the name, the use of XML is not required; JSON is
often used instead (see AJAJ), and the requests do not need to be asynchronous.[4]
Ajax is not a single technology, but a group of technologies. HTML and CSS can be used
in combination to mark up and style information. The DOM is accessed with JavaScript
to dynamically display and allow the user to interact with the information presented.
JavaScript and the XMLHttpRequest object provide a method for exchanging data
asynchronously between browser and server to avoid full page reloads.
Example[edit]
Here is an example of a simple Ajax request using the GET method, written in JavaScript.
get-ajax-data.js:
// This is the client-side script
// Initialize the Ajax request

var xhr = new XMLHttpRequest();


xhr.open('get', 'send-ajax-data.php');
// Track the state changes of the request
xhr.onreadystatechange = function(){
// Ready state 4 means the request is done
if(xhr.readyState === 4){
// 200 is a successful return
if(xhr.status === 200){
alert(xhr.responseText); // 'This is the returned text.'
}else{
alert('Error: '+xhr.status); // An error occurred during the request
}
}
}
// Send the request to send-ajax-data.php
xhr.send(null);
send-ajax-data.php:
<?php
// This is the server-side script
// Set the content type
header('Content-Type: text/plain');
// Send the data back
echo "This is the returned text.";
?>
jQuery example
This example uses the popular JavaScript library jQuery, to do the same thing as the
example above.
$.get('send-ajax-data.php', function(data) {
alert(data);
});

XML
Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format that is bothhuman-readable and machine-readable. It is
defined in the XML 1.0 Specification[2] produced by the W3C, and several other related
specifications,[3] all free open standards.[4]
The design goals of XML emphasize simplicity, generality, and usability over the
Internet.[5] It is a textual data format with strong support via Unicode for different human
languages. Although the design of XML focuses on documents, it is widely used for the
representation of arbitrary data structures,[6] for example in web services.
Many application programming interfaces (APIs) have been developed to aid software
developers with processing XML data, and several schema systems exist to aid in the
definition of XML-based languages.
Key terminology[edit]
The material in this section is based on the XML Specification. This is not an exhaustive
list of all the constructs that appear in XML; it provides an introduction to the key
constructs most often encountered in day-to-day use.
(Unicode) character
By definition, an XML document is a string of characters. Almost every legal
Unicode character may appear in an XML document.
Processor and application
The processor analyzes the markup and passes structured information to an
application. The specification places requirements on what an XML processor must
do and not do, but the application is outside its scope. The processor (as the
specification calls it) is often referred to colloquially as an XML parser.
Markup and content
The characters making up an XML document are divided into markup and content,
which may be distinguished by the application of simple syntactic rules. Generally,
strings that constitute markup either begin with the character < and end with a >, or
they begin with the character & and end with a ;. Strings of characters that are not
markup are content. However, in a CDATA section, the delimiters <![CDATA[ and
]]> are classified as markup, while the text between them is classified as content. In
addition, whitespace before and after the outermost element is classified as markup.
Tag
A markup construct that begins with < and ends with >. Tags come in three flavors:
start-tags; for example: <section>
end-tags; for example: </section>

empty-element tags; for example: <line-break />


Element
A logical document component which either begins with a start-tag and ends with a
matching end-tag or consists only of an empty-element tag. The characters between
the start- and end-tags, if any, are the element's content, and may contain markup,
including other elements, which are called child elements. An example of an element
is<Greeting>Hello, world.</Greeting> (see hello world). Another is <line-break />.
Attribute
A markup construct consisting of a name/value pair that exists within a start-tag or
empty-element tag. In the example (below) the element img has two attributes, src
and alt:
<img src="madonna.jpg" alt='Foligno Madonna, by Raphael' />
Another example would be
<step number="3">Connect A to B.</step>
where the name of the attribute is "number" and the value is "3".
An XML attribute can only have a single value and each attribute can appear at most
once on each element. In the common situation where a list of multiple values is
desired, this must be done by encoding the list into a well-formed XML attribute[note
1] with some format beyond what XML defines itself. Usually this is either a comma
or semi-colon delimited list or, if the individual values are known not to contain
spaces,[note 2] a space-delimited list can be used.
<div class="inner greeting-box" >Hello!</div>
where the attribute "class" has both the value "inner greeting-box" and also indicates
the two CSS class names "inner" and "greeting-box".
XML declaration
XML documents may begin by declaring some information about themselves, as in
the following example:
<?xml version="1.0" encoding="UTF-8"?>
Characters and escaping[edit]
XML documents consist entirely of characters from the Unicode repertoire. Except for a
small number of specifically excluded control characters, any character defined by
Unicode may appear within the content of an XML document.
XML includes facilities for identifying the encoding of the Unicode characters that make
up the document, and for expressing characters that, for one reason or another, cannot be
used directly.
Valid characters[edit]
Main article: Valid characters in XML

Unicode code points in the following ranges are valid in XML 1.0 documents:[10]
U+0009, U+000A, U+000D: these are the only C0 controls accepted in XML 1.0;
U+0020U+D7FF, U+E000U+FFFD: this excludes some (not all) noncharacters in the BMP (all surrogates, U+FFFE and U+FFFF are forbidden);
U+10000U+10FFFF: this includes all code points in supplementary planes,
including non-characters.
XML 1.1[11] extends the set of allowed characters to include all the above, plus the
remaining characters in the range U+0001U+001F. At the same time, however, it
restricts the use of C0 and C1 control characters other than U+0009, U+000A, U+000D,
and U+0085 by requiring them to be written in escaped form (for example U+0001 must
be written as &#x01; or its equivalent). In the case of C1 characters, this restriction is a
backwards incompatibility; it was introduced to allow common encoding errors to be
detected.
The code point U+0000 is the only character that is not permitted in any XML 1.0 or 1.1
document.
Encoding detection[edit]
The Unicode character set can be encoded into bytes for storage or transmission in a
variety of different ways, called "encodings". Unicode itself defines encodings that cover
the entire repertoire; well-known ones include UTF-8 and UTF-16.[12] There are many
other text encodings that predate Unicode, such as ASCII and ISO/IEC 8859; their
character repertoires in almost every case are subsets of the Unicode character set.
XML allows the use of any of the Unicode-defined encodings, and any other encodings
whose characters also appear in Unicode. XML also provides a mechanism whereby an
XML processor can reliably, without any prior knowledge, determine which encoding is
being used.[13] Encodings other than UTF-8 and UTF-16 will not necessarily be
recognized by every XML parser.
Escaping[edit]
XML provides escape facilities for including characters which are problematic to include
directly. For example:
The characters "<" and "&" are key syntax markers and may never appear in
content outside a CDATA section.[14]
Some character encodings support only a subset of Unicode. For example, it is
legal to encode an XML document in ASCII, but ASCII lacks code points for Unicode
characters such as "".
It might not be possible to type the character on the author's machine.

Some characters have glyphs that cannot be visually distinguished from other
characters: examples are
non-breaking space (&#xa0;) " "
compare space (&#x20;) " "
Cyrillic Capital Letter A (&#x410;) ""
compare Latin Capital Letter A (&#x41;) "A"
There are five predefined entities:

&lt; represents "<"


&gt; represents ">"
&amp; represents "&"
&apos; represents '
&quot; represents "

All permitted Unicode characters may be represented with a numeric character reference.
Consider the Chinese character "", whose numeric code in Unicode is hexadecimal
4E2D, or decimal 20,013. A user whose keyboard offers no method for entering this
character could still insert it in an XML document encoded either as &#20013; or
&#x4e2d;. Similarly, the string "I <3 Jrg" could be encoded for inclusion in an XML
document as "I &lt;3 J&#xF6;rg".
"&#0;" is not permitted, however, because the null character is one of the control
characters excluded from XML, even when using a numeric character reference.[15] An
alternative encoding mechanism such as Base64 is needed to represent such characters.
Comments[edit]
Comments may appear anywhere in a document outside other markup. Comments cannot
appear before the XML declaration. Comments start with "<!--" and end with "-->". For
compatibility with SGML, the string "--" (double-hyphen) is not allowed inside
comments;[16] this means comments cannot be nested. The ampersand has no special
significance within comments, so entity and character references are not recognized as
such, and there is no way to represent characters outside the character set of the document
encoding.
An example of a valid comment: "<!--no need to escape <code> & such in comments-->"
XML 1.0 (Fifth Edition) and XML 1.1 support the direct use of almost any Unicode
character in element names, attributes, comments, character data, and processing
instructions (other than the ones that have special symbolic meaning in XML itself, such
as the less-than sign, "<"). The following is a well-formed XML document including
Chinese, Armenian and Cyrillic characters:
<?xml version="1.0" encoding="UTF-8"?>

< =""></>
Object-oriented programming
Object-oriented programming (OOP) is a programming paradigm that represents the
concept of "objects" that have data fields(attributes that describe the object) and
associated procedures known as methods. Objects, which are usually instances of classes,
are used to interact with one another to design applications and computer programs.[1][2]
C++, Objective-C, Smalltalk, Delphi, Java,Javascript, C#, Perl, Python, Ruby and PHP
are examples of object-oriented programming languages.

Systems development life cycle


The systems development life cycle (SDLC), also referred to as the application
development life-cycle, is a term used in systems engineering, information systems and
software engineering to describe a process for planning, creating, testing, and deploying
an information system.[1] The systems development life-cycle concept applies to a range
of hardware and software configurations, as a system can be composed of hardware only,
software only, or a combination of both.[2]

Overview[edit]
A systems
development life
cycle is composed
of a number of
clearly defined and
distinct work
phases which are
used by systems
engineers and
systems developers
to plan for, design,
build, test, and
deliver information systems. Like anything that is manufactured on an assembly line, an
SDLC aims to produce high quality systems that meet or exceed customer expectations,
based on customer requirements, by delivering systems which move through each clearly
defined phase, within scheduled time-frames and cost estimates.[3] Computer systems are
complex and often (especially with the recent rise of service-oriented architecture) link
multiple traditional systems potentially supplied by different software vendors. To
manage this level of complexity, a number of SDLC models or methodologies have been
created, such as "waterfall"; "spiral"; "Agile software development"; "rapid prototyping";
"incremental"; and "synchronize and stabilize".[4]
SDLC can be described along a spectrum of agile to iterative to sequential. Agile
methodologies, such as XP and Scrum, focus on lightweight processes which allow for
rapid changes (without necessarily following the pattern of SDLC approach) along the
development cycle. Iterative methodologies, such as Rational Unified Process and
dynamic systems development method, focus on limited project scope and expanding or
improving products by multiple iterations. Sequential or big-design-up-front (BDUF)
models, such as waterfall, focus on complete and correct planning to guide large projects
and risks to successful and predictable results[citation needed]. Other models, such as
anamorphic development, tend to focus on a form of development that is guided by
project scope and adaptive iterations of feature development.
In project management a project can be defined both with a project life cycle (PLC) and
an SDLC, during which slightly different activities occur. According to Taylor (2004)
"the project life cycle encompasses all the activities of the project, while the systems
development life cycle focuses on realizing the product requirements".[5]

SDLC is used during the development of an IT project, it describes the different stages
involved in the project from the drawing board, through the completion of the project.
Phases[edit]
The system development life cycle framework provides a sequence of activities for
system designers and developers to follow. It consists of a set of steps or phases in which
each phase of the SDLC uses the results of the previous one.
The SDLC adheres to important phases that are essential for developers, such as
planning, analysis, design, and implementation, and are explained in the section below. It
includes evaluation of present system, information gathering, feasibility study and request
approval. A number of SDLC models have been created: waterfall, fountain, spiral, build
and fix, rapid prototyping, incremental, and synchronize and stabilize. The oldest of
these, and the best known, is the waterfall model: a sequence of stages in which the
output of each stage becomes the input for the next. These stages can be characterized
and divided up in different ways, including the following:[7]
Preliminary analysis: The objective of phase 1 is to conduct a preliminary
analysis, propose alternative solutions, describe costs and benefits and submit a
preliminary plan with recommendations.
Conduct the preliminary analysis: in this step, you need to find out the
organization's objectives and the nature and scope of the problem
under study. Even if a problem refers only to a small segment of the
organization itself then you need to find out what the objectives of the
organization itself are. Then you need to see how the problem being
studied fits in with them.
Propose alternative solutions: In digging into the organization's
objectives and specific problems, you may have already covered some
solutions. Alternate proposals may come from interviewing employees,
clients, suppliers, and/or consultants. You can also study what
competitors are doing. With this data, you will have three choices:
leave the system as is, improve it, or develop a new system.
Describe the costs and benefits.
Systems analysis, requirements definition: Defines project goals into defined
functions and operation of the intended application. Analyzes end-user information
needs.
Systems design: Describes desired features and operations in detail, including
screen layouts, business rules, process diagrams, pseudocode and other
documentation.
Development: The real code is written here.
Integration and testing: Brings all the pieces together into a special testing

environment, then checks for errors, bugs and interoperability.


Acceptance, installation, deployment: The final stage of initial development,
where the software is put into production and runs actual business.
Maintenance: During the maintenance stage of the SDLC, the system is assessed
to ensure it does not become obsolete. This is also where changes are made to initial
software. It involves continuous evaluation of the system in terms of its performance.
Evaluation: Some companies do not view this as an official stage of the SDLC,
but is it an important part of the life cycle. Evaluation step is an extension of the
Maintenance stage, and may be referred to in some circles as Post-implementation
Review. This is where the system that was developed, as well as the entire process, is
evaluated. Some of the questions that need to be answered include: does the newly
implemented system meet the initial business requirements and objectives? Is the
system reliable and fault-tolerant? Does the system function according to the
approved functional requirements. In addition to evaluating the software that was
released, it is important to assess the effectiveness of the development process. If
there are any aspects of the entire process, or certain stages,that management is not
satisfied with, this is the time to improve. Evaluation and assessment is a difficult
issue. However, the company must reflect on the process and address weaknesses.
Disposal: In this phase, plans are developed for discarding system information,
hardware and software in making the transition to a new system. The purpose here is
to properly move, archive, discard or destroy information, hardware and software that
is being replaced, in a matter that prevents any possibility of unauthorized disclosure
of sensitive data. The disposal activities ensure proper migration to a new system.
Particular emphasis is given to proper preservation and archival of data processed by
the previous system. All of this should be done in accordance with the organization's
security requirements.[8]
In the following example (see picture) these stages of the systems development life cycle
are divided in ten steps from definition to creation and modification of IT work products:

Not every project will require that the phases be sequentially executed. However, the
phases are interdependent. Depending upon the size and complexity of the project, phases
may be combined or may overlap.[9]
System investigation[edit]
The system investigate the IT proposal. During this step, we must consider all current
priorities that would be affected and how they should be handled. Before any system
planning is done, a feasibility study should be conducted to determine if creating a new or
improved system is a viable solution. This will help to determine the costs, benefits,
resource requirements, and specific user needs required for completion. The development
process can only continue once management approves of the recommendations from the
feasibility study.[10]
Following are different components of the feasibility study:
Operational feasibility

Economic feasibility
Technical feasibility
Human factors feasibility
Legal/Political feasibility
System analysis[edit]
The goal of system analysis is to determine where the problem is in an attempt to fix the
system. This step involves breaking down the system in different pieces to analyze the
situation, analyzing project goals, breaking down what needs to be created and attempting
to engage users so that definite requirements can be defined.
Design[edit]
In systems design, the design functions and operations are described in detail, including
screen layouts, business rules, process diagrams and other documentation. The output of
this stage will describe the new system as a collection of modules or subsystems.
The design stage takes as its initial input the requirements identified in the approved
requirements document. For each requirement, a set of one or more design elements will
be produced as a result of interviews, workshops, and/or prototype efforts.
Design elements describe the desired system features in detail, and generally include
functional hierarchy diagrams, screen layout diagrams, tables of business rules, business
process diagrams, pseudo-code, and a complete entity-relationship diagram with a full
data dictionary. These design elements are intended to describe the system in sufficient
detail, such that skilled developers and engineers may develop and deliver the system
with minimal additional input design.
Environments[edit]
Environments are controlled areas where systems developers can build, distribute, install,
configure, test, and execute systems that move through the SDLC. Each environment is
aligned with different areas of the SDLC and is intended to have specific purposes.
Examples of such environments include the:
Development environment, where developers can work independently of each
other before trying to merge their work with the work of others,
Common build environment, where merged work can be built, together, as a
combined system,
Systems integration testing environment, where basic testing of a system's
integration points to other upstream or downstream systems can be tested,
User acceptance testing environment, where business stakeholders can test against
their original business requirements,

Production environment, where systems finally get deployed to, for final use by
their intended end users.
The planning for, provisioning, and operating of such environments is known as practice
of IT environment management.[11]
Testing[edit]
The code is tested at various levels in software testing. Unit, system and user acceptance
testings are often performed. This is a grey area as many different opinions exist as to
what the stages of testing are and how much, if any iteration occurs. Iteration is not
generally part of the waterfall model, but usually some occur at this stage. In the testing
the whole system is tested one by one
Following are the types of testing:
Defect testing the failed scenarios, including defect tracking
Path testing
Data set testing
Unit testing
System testing
Integration testing
Black-box testing
White-box testing
Regression testing
Automation testing
User acceptance testing
Software performance testing
Training and transition[edit]
Once a system has been stabilized through adequate testing, the SDLC ensures that
proper training on the system is performed or documented before transitioning the system
to its support staff and end users.
Training usually covers operational training for those people who will be responsible for
supporting the system as well as training for those end users who will be using the system
after its delivery to a production operating environment.
After training has been successfully completed, systems engineers and developers
transition the system to its final production environment, where it is intended to be used
by its end users and supported by its support and operations staff.
Operations and maintenance[edit]
The deployment of the system includes changes and enhancements before the

decommissioning or sunset of the system. Maintaining the system is an important aspect


of SDLC. As key personnel change positions in the organization, new changes will be
implemented. There are two approaches to system development; there is the traditional
approach (structured) and object oriented. Information Engineering includes the
traditional system approach, which is also called the structured analysis and design
technique. The object oriented approach views the information system as a collection of
objects that are integrated with each other to make a full and complete information
system.
Evaluation[edit]
The final phase of the SDLC is to measure the effectiveness of the application and
evaluate potential enhancements.
Systems analysis and design[edit]
The systems analysis and design (SAD) is the process of developing information systems
(IS) that effectively use hardware, software, data, processes, and people to support the
company's businesses objectives. System analysis and design can be considered the metadevelopment activity, which serves to set the stage and bound the problem. SAD can be
leveraged to set the correct balance among competing high-level requirements in the
functional and non-functional analysis domains. System analysis and design interacts
strongly with distributed enterprise architecture, enterprise I.T. Architecture, and business
architecture, and relies heavily on concepts such as partitioning, interfaces, personae and
roles, and deployment/operational modeling to arrive at a high-level system description.
This high level description is then further broken down into the components and modules
which can be analyzed, designed, and constructed separately and integrated to accomplish
the business goal. SDLC and SAD are cornerstones of full life cycle product and system
planning.
Object-oriented analysis[edit]
Object-oriented analysis (OOA) is the process of analyzing a task (also known as a
problem domain), to develop a conceptual model that can then be used to complete the
task. A typical OOA model would describe computer software that could be used to
satisfy a set of customer-defined requirements. During the analysis phase of problemsolving, a programmer might consider a written requirements statement, a formal vision
document, or interviews with stakeholders or other interested parties. The task to be
addressed might be divided into several subtasks (or domains), each representing a
different business, technological, or other areas of interest. Each subtask would be
analyzed separately. Implementation constraints, (e.g., concurrency, distribution,
persistence, or how the system is to be built) are not considered during the analysis phase;

rather, they are addressed during object-oriented design (OOD).


The conceptual model that results from OOA will typically consist of a set of use cases,
one or more UML class diagrams, and a number of interaction diagrams. It may also
include some kind of user interface mock-up.
The input for object-oriented design is provided by the output of object-oriented analysis.
Realize that an output artifact does not need to be completely developed to serve as input
of object-oriented design; analysis and design may occur in parallel, and in practice the
results of one activity can feed the other in a short feedback cycle through an iterative
process. Both analysis and design can be performed incrementally, and the artifacts can
be continuously grown instead of completely developed in one shot.
Some typical input artifacts for object-oriented :
Conceptual model: Conceptual model is the result of object-oriented analysis, it
captures concepts in the problem domain. The conceptual model is explicitly chosen
to be independent of implementation details, such as concurrency or data storage.
Use case: Use case is a description of sequences of events that, taken together,
lead to a system doing something useful. Each use case provides one or more
scenarios that convey how the system should interact with the users called actors to
achieve a specific business goal or function. Use case actors may be end users or
other systems. In many circumstances use cases are further elaborated into use case
diagrams. Use case diagrams are used to identify the actor (users or other systems)
and the processes they perform.
System Sequence Diagram: System Sequence diagram (SSD) is a picture that
shows, for a particular scenario of a use case, the events that external actors generate,
their order, and possible inter-system events.
User interface documentations (if applicable): Document that shows and describes
the look and feel of the end product's user interface. It is not mandatory to have this,
but it helps to visualize the end-product and therefore helps the designer.
Relational data model (if applicable): A data model is an abstract model that
describes how data is represented and used. If an object database is not used, the
relational data model should usually be created before the design, since the strategy
chosen for object-relational mapping is an output of the OO design process. However,
it is possible to develop the relational data model and the object-oriented design
artifacts in parallel, and the growth of an artifact can stimulate the refinement of other
artifacts.
Life cycle[edit]
Management and control[edit]

SPIU phases
related to
management
controls.[12]
The SDLC
phases serve
as a

programmatic guide to project activity and provide a flexible but consistent way to
conduct projects to a depth matching the scope of the project. Each of the SDLC phase
objectives are described in this section with key deliverables, a description of
recommended tasks, and a summary of related control objectives for effective
management. It is critical for the project manager to establish and monitor control
objectives during each SDLC phase while executing projects. Control objectives help to
provide a clear statement of the desired result or purpose and should be used throughout
the entire SDLC process. Control objectives can be grouped into major categories
(domains), and relate to the SDLC phases as shown in the figure.[12]
To manage and control any SDLC initiative, each project will be required to establish
some degree of a work breakdown structure (WBS) to capture and schedule the work
necessary to complete the project. The WBS and all programmatic material should be
kept in the "project description" section of the project notebook. The WBS format is
mostly left to the project manager to establish in a way that best describes the project
work.
There are some key areas that must be defined in the WBS as part of the SDLC policy.
The following diagram describes three key areas that will be addressed in the WBS in a
manner established by the project manager.[12]
Work breakdown structured organization[edit]

Work
breakdown
structure.[12]
The upper

section of the work breakdown structure (WBS) should identify the major phases and
milestones of the project in a summary fashion. In addition, the upper section should
provide an overview of the full scope and timeline of the project and will be part of the
initial project description effort leading to project approval. The middle section of the
WBS is based on the seven systems development life cycle phases as a guide for WBS
task development. The WBS elements should consist of milestones and "tasks" as
opposed to "activities" and have a definitive period (usually two weeks or more). Each
task must have a measurable output (e.x. document, decision, or analysis). A WBS task
may rely on one or more activities (e.g. software engineering, systems engineering) and
may require close coordination with other tasks, either internal or external to the project.
Any part of the project needing support from contractors should have a statement of work
(SOW) written to include the appropriate tasks from the SDLC phases. The development
of a SOW does not occur during a specific phase of SDLC but is developed to include the
work from the SDLC process that may be conducted by external resources such as
contractors.[12]
Baselines[edit]
Baselines are an important part of the systems development life cycle. These baselines are
established after four of the five phases of the SDLC and are critical to the iterative
nature of the model .[13] Each baseline is considered as a milestone in the SDLC.

functional baseline: established after the conceptual design phase.


allocated baseline: established after the preliminary design phase.
product baseline: established after the detail design and development phase.
updated product baseline: established after the production construction phase.

Multitier architecture

In software engineering, multi-tier architecture (often referred to as n-tier architecture) is


a clientserver architecture in which presentation, application processing, and data
management functions are physically separated. The most widespread use of multi-tier
architecture is the three-tier architecture.
N-tier application architecture provides a model by which developers can create flexible
and reusable applications. By segregating an application into tiers, developers acquire the
option of modifying or adding a specific layer, instead of reworking the entire
application. A Three-tier architecture is typically composed of a presentation tier, a
domain logic tier, and a data storage tier.
While the concepts of layer and tier are often used interchangeably, one fairly common
point of view is that there is indeed a difference. This view holds that a layer is a logical
structuring mechanism for the elements that make up the software solution, while a tier is
a physical structuring mechanism for the system infrastructure.[1] [2]
Three-tier architecture[edit]

Visual
overview of a
Three-tiered
application
Three-tier
architecture
is a client
server
architecture
in which the
user interface

(presentation), functional process logic ("business rules"), computer data storage and data
access are developed and maintained as independent modules, most often on separate
platforms.[3] It was developed by John J. Donovan in Open Environment Corporation
(OEC), a tools company he founded in Cambridge, Massachusetts.
The three-tier model is a software architecture pattern.
Apart from the usual advantages of modular software with well-defined interfaces, the

three-tier architecture is intended to allow any of the three tiers to be upgraded or


replaced independently in response to changes in requirements or technology. For
example, a change of operating system in the presentation tier would only affect the user
interface code.
Typically, the user interface runs on a desktop PC or workstation and uses a standard
graphical user interface, functional process logic that may consist of one or more separate
modules running on a workstation orapplication server, and an RDBMS on a database
server or mainframe that contains the computer data storage logic. The middle tier may
be multi-tiered itself (in which case the overall architecture is called an "n-tier
architecture").
Three-tier architecture:
Presentation tier
This is the topmost level of the application. The presentation tier displays information
related to such services as browsing merchandise, purchasing and shopping cart
contents. It communicates with other tiers by which it puts out the results to the
browser/client tier and all other tiers in the network. (In simple terms it is a layer
which users can access directly such as a web page, or an operating systems GUI)
Application tier (business logic, logic tier, or middle tier)
The logical tier is pulled out from the presentation tier and, as its own layer, it
controls an applications functionality by performing detailed processing.
Data tier
The data tier includes the data persistence mechanisms (database servers, file shares,
etc.) and the data access layer that encapsulates the persistence mechanisms and
exposes the data. The data access layer should provide an Application Programming
Interface (API) to the application tier that exposes methods of managing the stored
data without exposing or creating dependencies on the data storage mechanisms.
Avoiding dependencies on the storage mechanisms allows for updates or changes
without the application tier clients being affected by or even aware of the change. As
with the separation of any tier, there are costs for implementation and often costs to
performance in exchange for improved scalability and maintainability.
Web development usage[edit]
In the web development field, three-tier is often used to refer to websites, commonly
electronic commerce websites, which are built using three tiers:
1 A front-end web server serving static content, and potentially some cached
dynamic content. In web based application, Front End is the content rendered by the
browser. The content may be static or generated dynamically.
2 A middle dynamic content processing and generation level application server, for
example Ruby on Rails, Java EE, ASP.NET, PHP, ColdFusion, Perl, Python platform.
3 A back-end database or data store, comprising both data sets and the database

management system software that manages and provides access to the data.
Other considerations[edit]
Data transfer between tiers is part of the architecture. Protocols involved may include one
or more of SNMP, CORBA, Java RMI, .NET Remoting, Windows Communication
Foundation, sockets, UDP, web services or other standard or proprietary protocols. Often
middleware is used to connect the separate tiers. Separate tiers often (but not necessarily)
run on separate physical servers, and each tier may itself run on a cluster.
Traceability[edit]
The end-to-end traceability of data flows through n-tier systems is a challenging task
which becomes more important when systems increase in complexity. The Application
Response Measurement defines concepts and APIs for measuring performance and
correlating transactions between tiers. Generally, the term "tiers" is used to describe
physical distribution of components of a system on separate servers, computers, or
networks (processing nodes). A three-tier architecture then will have three processing
nodes. The term "layers" refer to a logical grouping of components which may or may not
be physically located on one processing node.

Clientserver model
The clientserver model of computing is a distributed application structure that partitions
tasks or workloads between the providers of a resource or service, called servers, and
service requesters, called clients.[1] Often clients and servers communicate over a
computer network on separate hardware, but both client and server may reside in the
same system. A server host runs one or more server programs which share their resources
with clients. A client does not share any of its resources, but requests a server's content or
service function. Clients therefore initiate communication sessions with servers which
await incoming requests.
Examples of computer applications that use the clientserver model are Email, network
printing, and the World Wide Web.
Client and server
roles[edit]
The clientserver
characteristic describes the relationship of cooperating programs in an application. The
server component provides a function or service to one or many clients, which initiate
requests for such services.
Servers are classified by the services they provide. For instance, a web server serves web
pages and a file server serves computer files. A shared resource may be any of the server
computer's software and electronic components, from programs and data to processors
and storage devices. The sharing of resources of a server constitute a service.
Whether a computer is a client, a server, or both, is determined by the nature of the
application that requires the service functions. For example, a single computer can run
web server and file server software at the same time to serve different data to clients
making different kinds of requests. Client software can also communicate with server
software within the same computer.[2] Communication between servers, such as to
synchronize data, is sometimes called inter-server or server-to-server communication.

Client and server communication[edit]


In general, a service is an abstraction of computer resources and a client does not have to
be concerned with how the server performs while fulfilling the request and delivering the
response. The client only has to understand the response based on the well-known
application protocol, i.e. the content and the formatting of the data for the requested
service.
Clients and servers exchange messages in a request-response messaging pattern: The
client sends a request, and the server returns a response. This exchange of messages is an
example of inter-process communication. To communicate, the computers must have a
common language, and they must follow rules so that both the client and the server know
what to expect. The language and rules of communication are defined in a
communications protocol. All client-server protocols operate in the application layer. The
application-layer protocol defines the basic patterns of the dialogue. To formalize the data
exchange even further, the server may implement an API (such as a web service).[3] The
API is anabstraction layer for such resources as databases and custom software. By
restricting communication to a specific content format, it facilitates parsing. By
abstracting access, it facilitates cross-platform data exchange.[4]
A server may receive requests from many different clients in a very short period of time.
Because the computer can perform a limited number of tasks at any moment, it relies on
ascheduling system to prioritize incoming requests from clients in order to accommodate
them all in turn. To prevent abuse and maximize uptime, the server's software limits how
a client can use the server's resources. Even so, a server is not immune from abuse. A
denial of service attack exploits a server's obligation to process requests by bombarding it
with requests incessantly. This inhibits the server's ability to responding to legitimate
requests.
Example[edit]
When a bank customer accesses online banking services with a web browser (the client),
the client initiates a request to the bank's web server. The customer's login credentials
may be stored in a database, and the web server accesses the database server as a client.
An application server interprets the returned data by applying the bank's business logic,
and provides the output to the web server. Finally, the web server returns the result to the
client web browser for display.
In each step of this sequence of clientserver message exchanges, a computer processes a
request and returns data. This is the request-response messaging pattern. When all the

requests are met, the sequence is complete and the web browser presents the data to the
customer.
This example illustrates a design pattern applicable to the clientserver model: separation
of concerns.

What is jQuery?
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML
document traversal and manipulation, event handling, animation, and Ajax much simpler
with an easy-to-use API that works across a multitude of browsers. With a combination of
versatility and extensibility, jQuery has changed the way that millions of people write
JavaScript.
A Brief Look

DOM Traversal and Manipulation


Get the <button> element with the class 'continue' and change its HTML to 'Next Step...'
1

$( "button.continue" ).html( "Next Step..." )

Event Handling
Show the #banner-message element that is hidden with display:none in its CSS when any
button in #button-container is clicked.
1
2
3
4

var hiddenBox = $( "#banner-message" );


$( "#button-container button" ).on( "click", function( event ) {
hiddenBox.show();
});

Ajax
Call a local script on the server /api/getWeather with the query parameter zipcode=97201
and replace the element #weather-temp's html with the returned text.
1
2
3
4
5
6
7
8
9

$.ajax({
url: "/api/getWeather",
data: {
zipcode: 97201
},
success: function( data ) {
$( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" );
}
});

Why AngularJS?
HTML is great for declaring static documents, but it falters when we try to use it for
declaring dynamic views in web-applications. AngularJS lets you extend HTML
vocabulary for your application. The resulting environment is extraordinarily expressive,
readable, and quick to develop.
Alternatives
Other frameworks deal with HTMLs shortcomings by either abstracting away HTML,
CSS, and/or JavaScript or by providing an imperative way for manipulating the DOM.
Neither of these address the root problem that HTML was not designed for dynamic
views.
Extensibility
AngularJS is a toolset for building the framework most suited to your application
development. It is fully extensible and works well with other libraries. Every feature can
be modified or replaced to suit your unique development workflow and feature needs.
Read on to find out how.

Add Some Control


Data Binding
Data-binding is an automatic way of updating the view whenever the model changes, as
well as updating the model whenever the view changes. This is awesome because it
eliminates DOM manipulation from the list of things you have to worry about.
Controller
Controllers are the behavior behind the DOM elements. AngularJS lets you express the
behavior in a clean readable form without the usual boilerplate of updating the DOM,
registering callbacks or watching model changes.
Plain JavaScript
Unlike other frameworks, there is no need to inherit from proprietary types in order to
wrap the model in accessors methods. Angular models are plain old JavaScript objects.
This makes your code easy to test, maintain, reuse, and again free from boilerplate.
<div ng-app="todoApp">
<h2>Todo</h2>
<div ng-controller="TodoController">
<span>{{remaining()}} of {{todos.length}} remaining</span>
[ <a href="" ng-click="archive()">archive</a> ]
<ul class="unstyled">
<li ng-repeat="todo in todos">
<input type="checkbox" ng-model="todo.done">
<span class="done-{{todo.done}}">{{todo.text}}</span>
</li>
</ul>
<form ng-submit="addTodo()">
<input type="text" ng-model="todoText" size="30"
placeholder="add new todo here">
<input class="btn-primary" type="submit" value="add">
</form>
</div>
</div>
angular.module('todoApp', [])
.controller('TodoController', ['$scope', function($scope) {
$scope.todos = [
{text:'learn angular', done:true},
{text:'build an angular app', done:false}];
$scope.addTodo = function() {
$scope.todos.push({text:$scope.todoText, done:false});
$scope.todoText = '';

};
$scope.remaining = function() {
var count = 0;
angular.forEach($scope.todos, function(todo) {
count += todo.done ? 0 : 1;
});
return count;
};
$scope.archive = function() {
var oldTodos = $scope.todos;
$scope.todos = [];
angular.forEach(oldTodos, function(todo) {
if (!todo.done) $scope.todos.push(todo);
});
};
}]);
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitterbootstrap/2.0.4/css/bootstrap-combined.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0rc.4/angular.min.js"></script>
<style>
.done-true {
text-decoration: line-through;
color: grey;
}

Bootstrap
Bootstrap (currently v3.2.0) has a few easy ways to quickly get started, each one
appealing to a different skill level and use case. Read through to see what suits your
particular needs.
Bootstrap
Compiled and minified CSS, JavaScript, and fonts. No docs or original source files are
included.
Download Bootstrap
Source code
Source Less, JavaScript, and font files, along with our docs. Requires a Less compiler
and some setup.
Download source
Sass
Bootstrap ported from Less to Sass for easy inclusion in Rails, Compass, or Sass-only
projects.
Download Sass

Start with this basic HTML template, or modify these examples. We hope you'll
customize our templates and examples, adapting them to suit your needs.
Copy the HTML below to begin working with a minimal Bootstrap document.
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries
-->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>

Json.NET
Popular high-performance JSON framework for .NET
Download Source code

Version 6.0.5 - Created by James Newton-King World-class JSON Serializer


Serialize and deserialize any .NET object with Json.NET's powerful JSON serializer.
LINQ to JSON
Create, parse, query and modify JSON using Json.NET's JObject/JArray/JValue
objects.
JSON Schema Validation
Validate incoming JSON using JSON Schema. Find out more at json-schema.org.
High Performance
50% faster than DataContractJsonSerailzier, 250% faster than JavaScriptSerializer.
Easy To Use
Json.NET makes the simple easy and the complex possible.

XML Support
If you need it Json.NET supports converting between XML and JSON.
Open Source
Json.NET is open source software and is completelyfree for commercial use.

Run Anywhere
Json.NET supports Windows, Silverlight, Windows Phone, Mono, MonoTouch and
MonoDroid.
Most Popular .NET library
Over 3 million downloads and counting, Json.NET is the number one .NET library
on NuGet.
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product);
//{
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
//}

Serialize JSON

string json = @"{


'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
// Bad Boys

Deserialize JSON

JArray array = new JArray();


array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
string json = o.ToString();
// {
// "MyArray": [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
// }

LINQ to JSON

JsonSchema schema = JsonSchema.Parse(@"{


'type': 'object',
'properties': {
'name': {'type':'string'},
'hobbies': {'type': 'array'}
}
}");
JObject person = JObject.Parse(@"{
'name': 'James',
'hobbies': ['.NET', 'LOLCATS']
}");
bool valid = person.IsValid(schema);
// true

Validate JSON

Algoritma Menentukan Bilangan Ganjil, Genap dan Nol.


Diketahui sebuah bilangan, akan diuji bilangan ganjil, genap atau nol.
Struktur Indonesia
1 Mulai
2 Inisiasi bil integer.
3 Baca bil.
4 Jika bil = 0 maka kerjakan langkah 6, selain itu.
5 Jika bil mod 2 = 0 maka kerjakan langkah 7, selain itu kerjakan langkah 8.
6 Cetak Bilangan Nol
7 Cetak Bilangan Genap.
8 Cetak Bilangan Ganjil.
9 Selesai
Untuk Flowchart nya bisa dilihat pada gambar di bawah ini :

Flowchart menentukan bilangan ganjil, genap dan nol.


Semuga tulisan saya dapat membantu anda yang sedang belajar Algoritma dan
Pemograman.

Algoritma pemrograman
Pada kesempatan ini saya akan membahas tentang algoritma untuk menentukan
bilangan genap dan ganjil serta algoritma untuk menampilkan bilangan prima
dari 0 sampai 100 dan menampilkan jumlah bilangan Genap, Ganjil, Prima.
Sebelum kita membahas algoritma diatas sebaiknya kita harus tahu dulu apa
sejarah algoritma, pengertian algoritma dan kegunaan dari algoritma tersebut.
1. Sejarah Algoritma

Algoritma berasal dari nama penulis buku arab yang terkenal yaitu Abu Jafar
Muhamma Ibnu Musa Al-Khuwarizmi. Al-Khuwarizmi dibaca orang barat menjadi
Algorism. Al-Khuwarizmi menulis buku yang berjudul Kitab Al Jabar WalMuqabala yang artinya Buku pemugaran dan pengurangan (The book of
restoration and reduction). Dari judul buku itu kita juga memperoleh akar kata
Aljabar (Algebra). Perubahan kata dari algorism menjadi algorithmmuncul
karena kata algorism sering dikelirukan dengan arithmetic, sehingga akhiran sm
berubah menjadi thm. Karena perhitungan dengan angka Arab sudah menjadi
hal yang biasa, maka lambat laun kata algorithm berangsur angsur dipakai
sebagai metode perhitungan (komputasi) secara umum, sehingga kehilangan
makna kata aslinya. Dalam bahasa Indonesia, kata algorithm diserap menjadi
algoritma.
2. Pengertian Algoritma
Algoritma adalah langkah langkah logis yang disusun secara sistematis untuk
menyelesaikan suatu masalah.Algoritma adalah dasar dan pondasi untuk
membuat suatu program komputer yang baik. Pemahaman algoritma yang baik
sangat menentukan kulitas dari suatu program yang kita buat, untuk itu jangan
tergesa-gesa

dalam

membuat

program

atau

bahkan

malas menyusun

algoritmaya bisa jadi program yang anda buat tidak berhasil atau error.

Algoritma pemograman yang baik memiliki ciri-ciri sebagai berikut :


Tepat, benar, sederhana, dan efektif.
Logis, terstruktur, dan sistematis.
Semua operasi terdefinisi.
Semua proses harus berakhir setelah sejumlah langkah dilakukan
Contoh algoritma sederhana dalam dunia nyata
Jika seseorang ingin mengirim surat kepada temannya di tempat lain, langkah

yang harus dilakukan adalah :


Menulis surat.
Surat dimasukkan ke dalam amplop tertutup
Amplop ditempeli perangko secukupnya.
Pergi ke Kantor Pos terdekat untuk mengirimkannya
3. Kegunaan Algoritma
Algoritma sangat menbantu dalam pembuatan program. Pembuatan algoritma
mempunyai banyak keuntungan di antaranya :
1. Pembuatan atau penulisan algoritma tidak tergantung pada bahasa
pemrograman manapun, artinya penulisan algoritma independen dari bahasa
pemrograman dan komputer yang melaksanakannya.
2. Notasi

algoritma

dapat

diterjemahkan

ke

dalam

berbagai

bahasa

pemrograman.
3. Apapun bahasa pemrogramannya, output yang akan dikeluarkan sama
karena algoritmanya sama.

di bawah ini adalah macam-macam dari algoritma tersebut


1. Menampilkan Bilangan Genap dan Ganjil dari 1 100
Judul : BilanganGenapGanjil
Spesifikasi : Program akan menampilkan bilangan genap dan ganjil dari 1
sampai 100 pada layar monitor
Deklarasi (kamus) :

i : integer
Deskripsi :
write (Bilangan Ganjil = )
for i = 1 to 100
if i mod 2 != 0 then
write (i)
write (Bilangan Genap = )
for i = 1 to 100
if i mod 2 = 0 then
write(i)
2. Menampilkan Bilangan Prima dari 1 100
Judul : BilanganPrima
Spesifikasi : Program akan menampilkan bilangan prima dari 1 100 pada layar
monitor
Deklarasi (kamus) :
bilPrima : boolean
i : int
j : int
Deskripsi :
write (Program Menampilkan Bilangan Prima dari 1 100)
write (Bilangan Prima 1 100 => )
for i = 1 to 100
bilPrima <-- true
if i > 1 then
for j = 2 to j < i
if i mod j = 0 then
bilPrima <-- false

break
if bilPrima = true then
write(i)
3. Menghitung Jumlah Bilangan Ganjil, Genap, dan Prima dari 1 100
Judul : Menampilkan Ganjil Genap Prima
Spesifikasi : Program akan menghitung jumlah bilangan ganjil, genap, dan prima
dari mulai 1 100. Selanjutnya jumlah bilangan ganjil, genap dan prima tersebut
ditampilkan di layar monitor.
Deklarasi (kamus) :
bilPrima : boolean
i : int
j : int
Deskripsi :
jumlahGanjil : int
jumlahGenap : int
jumlahPrima : int
write (Program Menampilkan Jumlah Bilangan Genap, Ganjil, dan Prima dari 1
100)
for i = 1 to 100
bilPrima <-- true
if i > 1 then
for j = 2 to j < i
if i mod j = 0 then
bilPrima <-- false
break
if bilPrima = true then
jumlahPrima <-- jumlahPrima + 1

if i mod 2 = 0 then
jumlahGenap <-- jumlahGenap + 1
else
jumlahGanjil <-- jumlahGanjil +1
write (Jumlah Bilangan Genap, jumlahGenap)
write (Jumlah Bilangan Ganjil, jumlahGanjil)
write (Jumlah Bilangan Prima, jumlahPrima)