0% found this document useful (0 votes)
3 views17 pages

Internet Based Programingnotes

Uploaded by

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

Internet Based Programingnotes

Uploaded by

kmwanziam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MINISTRY OF EDUCATION

 DIPLOMA IN
 INFORMATION
 COMMUNICATION
 TECHNOLOGY

Here’s the information extracted from the second image you uploaded:

TOPIC 1: INTRODUCTION TO INTERNET-BASED PROGRAMMING

T1.1) Internet-based programming

 Definition: Internet programming is a process of web development.


 It involves designing and adding programming procedures into internet websites.
 In general, an organization (with or without a physical presence) that has its own website
may include:
o Information content
o E-mail facilities
o E-commerce capabilities

T1.2) World Wide Web

 The World Wide Web (WWW) is an information space where documents and other
web resources are:
o Identified by Uniform Resource Locators (URLs)
o Interlinked by hypertext links
o Accessible via the Internet
 It is an information system that allows documents to be connected to other documents by
hypertext links, enabling users to move from one document to another while searching
for information.

🌐 World Wide Web – Origins and Purpose

 The Web is a collection of internet resources, including:


o FTP
o Telnet
o Usenet
o Hyperlinked text, audio, and video files
o Remote sites accessible via browsers
 It operates based on standards such as:
o HTTP (Hypertext Transfer Protocol)
o TCP/IP (Transmission Control Protocol/Internet Protocol)
 Creation:
o Invented in 1989 by Tim Berners-Lee, a UK physicist.
o Developed at CERN (European Particle Physics Laboratory, Conseil
Européen de Recherches Nucléaires) in Switzerland.
 Purpose:Designed as an easier way to access and organize information scattered
across the internet.

🌍 Website – Definition and Structure

 Basic Definition:
A website is a location connected to the Internet that maintains one or more pages on the
World Wide Web (WWW).
 Key Characteristics:
o A set of interconnected webpages, usually including a homepage.
o Located on the same server.
o Maintained as a collection of related information by a person, group, or
organization.
o Content stored under a common name (the website name).
 Additional Details (highlighted section):
o A website is a virtual location on the WWW.
o Contains several subject- or company-related webpages and data files.
o Accessible through a browser.
o Each website has a unique web address (URL).
o The homepage is the opening page of a website and contains hyperlinks to other
pages on the same or other site(s). A single web server may support multiple
websites and a single website may reside on multiple web servers, sometimes
thousands of miles apart.

URL

Computers

1. Uniform Resource Locator: a protocol for specifying addresses on the Internet.

2. An address that identifies a particular file on the Internet, usually consisting of the protocol, as
http, followed by the domain name.

Short for Uniform Resource Locator. An Internet address (for example,


[Link] usually consisting of the access protocol (http),
the domain name ([Link]), and optionally the path to a file ([Link]) or
resource residing on that server (trade).

DOMAIN NAME/WEBSITE NAME

A domain name is a unique name that identifies a website. For example, the domain name of the
Tech Terms Computer Dictionary is "[Link]." Each website has a domain name that
serves as an address, which is used to access the website.

Note: All domain names have a domain suffix, such as .com, .net, or .org. The domain suffix
helps identify the type of website the domain name represents. For example, ".com" domain
names are typically used by commercial website, while ".org" websites DNS (Domain Name
System)

Domain names are used as memorable identifiers for websites and services on the Internet, while
computers use IP addresses to locate these services. DNS facilitates this translation, allowing
users to access websites using domain names instead of numerical IP [Link] codes
are used in domain names, for example ".dk" for Denmark and ".se" for Sweden.

Example: You can access the Tech Terms Computer Dictionary using the domain name
"[Link]" instead of its IP address ([Link]).

DNS also simplifies email addressing by translating domain names following the "@" symbol to
the appropriate IP address.

DNS (Domain Name System)


DNS works like a smartphone's contact list. It associates unique IP addresses with domain
names, enabling computers to locate websites over the Internet.

The DNS translation table is distributed across millions of servers globally. Domain names must
be assigned to at least two nameservers. These nameservers maintain directories of domain
names and their corresponding IP addresses.

Domain name: A name owned by a person or organization and consisting of an alphabetical or


alphanumeric sequence followed by a suffix indicating the top-level domain: used as an Internet
address to identify the location of particular Web pages (Computing) a unique name,
corresponding to one or more numeric IP addresses, used to identify a particular web page or set
of web pages on the internet.

Http
Hypertext transfer protocol: the standard protocol for transferring hypertext documents on the
World Wide Web.

WEBPAGE

A document on the World Wide Web, consisting of an HTML file and any related files for
scripts and graphics, and often hyperlinked to other documents on the Web. The content of
webpages is normally accessed by using a browser.

Electronic (digital) document created with HTML and, therefore, accessible with a browser. In
addition to text and graphics, webpages may also contain downloadable data files, audio and
video files, and hyperlinks to other pages or sites. A website is usually a collection of webpages.

BROWSER

A browser is an application program that provides a way to look at and interact with all the
information on the World Wide Web. The word "browser" seems to have originated prior to the
Web as a generic term for user interfaces that let you browse (navigate through and read) text
files online.

A web browser (commonly referred to as a browser) is a software application for retrieving,


presenting and traversing information resources on the World Wide

Computer program (The two most popular browsers are Microsoft Internet Explorer and Firefox.
Other major browsers include Google Chrome, Apple Safari and Opera) that enables internet
users to access, navigate, and search World Wide Web sites. Browsers interpret hypertext links
('hotlinks') and allow documents formatted in hypertext markup language (HTML) to be viewed
on the computer screen, and provide many other services including email and downloading and
uploading of data, audio, and video files. Also called web browser.
T1.3) Role of web sites in organizations

The Importance of Having a Website for Businesses, Communities and Public Organizations not
Only for Individuals and Corporations

The importance of having a website cannot be understated whether it’s a website for a business,
a community or a public organization. Websites have a huge payoff in a variety of ways without
a huge investment of time or money. In fact, having a website doesn’t even need a ton of
technical expertise. What is important is to get a website up and running to begin reaping the
rewards.

ADVERTISING

One of the things that highlight the importance of having a website is advertising. A website
allows a user to quickly update addresses, phone numbers, products, services, events and any
other relevant details. These changes are far less expensive and less time consuming than
physically reprinting all sorts of different paper marketing materials.

MARKET EXPANSION

Having a website allows for substantial market growth. The internet has no limits, enabling
global access to information about a company, group, or organization. Market reach is not
restricted by time zones, countries, borders, or languages. Web browsers can translate websites
into the user's preferred language. Market expansion via a website is cost-effective compared to
traditional advertising methods like print mailers, newspaper ads, or television commercials.

CLIENT EXPECTATIONS

Society is increasingly digital. People expect quick answers and assume most entities have a
website. The internet has replaced traditional sources like directory assistance, yellow pages, and
local phone books for contact information. If information is not available online, it is almost as if
it does not exist.

24/7 AVAILABILITY

Websites can provide information to interested parties 24 hours a day, 7 days a week, regardless
of holidays or working hours. Websites are a cost-effective way to offer unlimited information at
all times.

CLIENT RELATIONS

Websites help strengthen relationships with current and prospective customers. Websites can
target marketing efforts, familiarize customers with a company’s brand, products, philosophies,
and employees, and serve as a communication venue.
ADDITIONAL SALES

Websites can facilitate additional sales through e-commerce technologies. Websites allow clients
to research offerings and expand the group’s size and reach.

WHAT ARE SOME OTHER BENEFITS OF HAVING A BUSINESS WEBSITE?

Cost Effective

A website provides predictable costs and avoids unexpected expenses associated with physical
stores, such as theft, damage, and extra staffing. A strategically developed website offers
significant benefits and clear costing outlines.

Accessible around the clock

Websites and social media accounts are available 24/7/365. The text gives an example of the
inconvenience of going to a physical store only to find it closed, emphasizing the constant
availability of online stores. Online presence allows customers and clients to access services
from anywhere, such as a coffee shop, couch, or bed.

Convenient

Shopping online from home is more convenient than driving around to different stores. The text
suggests that smart businesses recognize this and maintain websites to showcase their products
and services for easy customer browsing and purchasing.

Credibility

By building a website you are giving your business the opportunity to tell consumers why they
should trust you and the testimonials and facts to back up those opportunities. Believe it or not,
most people will search the internet for a product or service before the purchase to check the
credibility first. When you provide good service or product, positive word-of-mouth about your
business is likely to spread. Which in turn, delivers more repeat and new business.

People tend to trust a business after they have done business with it. Using your website, you can
continuously serve consumers online and increase your credibility as a business owner.

Sales

Without sales, or selling more than you spend, your business is doomed. By having an online
presence you allow for the sale of your products or services around the clock to whoever
whenever with no or hardly any limitations; Unless you run out of stock or overworked, but
that’s a good problem to have right! Giving your business the online presence it deserves is
crucial to your brand and accountants smile.
In short, being visible worldwide means you are very likely to gain more customers. The more
customers and visitors you have, the more sales you will generate. The more sales you generate
the happier you and your shareholders will be!

Marketing

Having a website and online presence strategy allows you to market your business online. There
are lots of marketing strategies you can use to advertise and market your business. All online
marketing strategies have been proven to be effective. Which ones you choose depends on the
type of business you are in. Speak to us to see which are best for your business.

TOPIC 2: WEB PROGRAMMING

T2.1) Explanation of Web programming

Web programming refers to the writing, markup and coding involved in Web development,
which includes Web content, Web client and server scripting and network security. Or Writing
the necessary source code to create a website

Web development refers to building, creating, and maintaining websites. It includes aspects
such as web design, web publishing, web programming, and database management.

T2.2) Approaches to web programming


Web programming can be briefly categorized into client and server coding. The client side needs
programming related to accessing data from users and providing information. It also needs to
ensure there are enough plug ins to enrich user experience in a graphic user interface, including
security measures.

Web development is all about communication. In this case, communication between two (2)
parties, over the HTTP protocol:

- The Server - This party is responsible for serving pages.

- The Client - This party requests pages from the Server, and displays them to the user. In most
cases, the client is a web browser.

- The User - The user uses the Client in order to surf the web, fill in forms, watch videos online,
etc.
Each side's programming, refers to code which runs at the specific machine, the server's or the
client's.

Basic Example

1. The User opens his web browser (the Client).

2. The User browses to [Link]

3. The Client (on the behalf of the User), sends a request to [Link] (the Server), for
their home page.

4. The Server then acknowledges the request, and replies the client with some meta-data (called
headers), followed by the page's source.

5. The Client then receives the page's source, and renders it into a human viewable website.

6. The User types Stack Overflow into the search bar, and presses Enter.

7. The Client submits that data to the Server.

8. The Server processes that data, and replies with a page matching the search results.

9. The Client, once again, renders that page for the User to view.

Server-side Programming

Server-side programming, is the general name for the kinds of programs which are run on the
Server.
Uses

- Process user input.

- Display pages.

- Structure web applications.

- Interact with permanent storage (SQL, files).

Example Languages

- PHP

- [Link] in C#, C++, or Visual Basic.

- Nearly any language (C++, C#, Java). These were not designed specifically for the task, but are
now often used for application-level web services.

Client-side programming

Much like the server-side, Client-side programming is the name for all of the programs which are
run on the Client.

Uses

- Make interactive webpages.

- Make stuff happen dynamically on the web page.

- Interact with temporary storage, and local storage (Cookies, localStorage).

- Send requests to the server, and retrieve data from it.

- Provide a remote service for client-side applications, such as software registration, content
delivery, or remote multi-player gaming.

Example languages

- JavaScript (primarily)

- HTML*

T2.3) WEB PROGRAMMING LANGUAGES


There are several languages that can be used for server-side programming:
- PHP

- [Link] (C# OR Visual Basic)

- C++

- Java and JSP

- Python

- Ruby on Rails and so on.

There are many client-side scripting languages too.

- JavaScript

- VBScript

- HTML (Structure)

- CSS (Designing)

- AJAX

- jQuery etc.

(Some other languages also can be used on the basis of the modeling/designing
/graphics/animations and for extra functionalities.)

T2.4) Criteria for choosing a web programming language


Choosing a programming language for your web application is a big decision. It is a complex
process and can have a huge impact on your business success.

1. Efficiency of the language itself;

2. Available platforms and frameworks;

3. Community support;

- How difficult the language is to learn. Mind you, if the language syntax and rules are complex,
you'll get more capable developers as only the best ones can get through. On the other hand,
there might be the scarcity of developers, which we see with the languages like Scala, Erlang,
Lisp, Prolog, Golang and others.
- Strategic issues: which tech stack your potential acquisition company is using, or which
technology stack they would prefer to have.

Factors to consider when choosing a programming language

1. Popularity. This is a very important one. A good place to start is the Tiobe index. You are
more likely to find people to collaborate with if you use a popular language. You are also more
likely to find reference material and other help. Unfortunately, the most popular language
globally may not be a good match for your problem domain.

2. Language-domain match. Choose one that matches your problem domain. You can do this
by looking at what other people in your field are using (after adjusting for popularity, so don't
think the match with Java is good simply because a lot of people are using Java) or by looking at
some code that solves problems you are likely to have and seeing how natural the mapping is.

3. Availability of libraries. Some would argue that this is the same as the point above, but I
don't think so. If there's a library that solves your problem well, you'll put up with some ugly
calling conventions or hassle in the language.

4. Efficiency. Languages aren't fast - compilers are efficient. Look at the efficiency of compilers
or interpreters for your language. Be aware that interpreted code will run an order of magnitude
slower than compiled code as a rule of thumb.

5. Expressiveness. The number of lines of code you create per hour is not a strong function of
language, so favors languages that are expressive or powerful.

6. Project-size. Do you want to be programming in the large or programming in the small?


Choose a language that supports your use case.

7. Tool support. Popularity usually buys tool support (and some languages are easier to write
tools for). If you are a tool-oriented user, choose a language with good tool support. Just read this
article on tool mavens vs language mavens before you make a choice.

PHP

It’s hard to argue against the popularity of PHP, the scripting language which is used by many
and has a vibrant developer community. It is used not only for WordPress development but also
for complex systems so even Facebook utilizes PHP, which says a lot about its level of
credibility.
Since PHP does not use too much of a system’s resources in order to run, it operates quite well
compared with other scripting languages. Hosting it is also very easy as lots of hosts provide
support for PHP.

Pros of PHP:

 It is highly accessible, there are a lot of frameworks written in it like


Symfony, Yii, Laravel, CakePHP, Kohana, Zend Framework,
PhalconPHP, to name a few.
 It enables fast implementation of complex solutions. And the faster a new
application enters the market, the higher is your cost-efficiency and the
greater is your competitive advantage.
 Thanks to the popularity of PHP, it offers great flexibility during and after
the initial project, as the number of resources is continuously growing.
 It has sound host support.
 PHP can be embedded in HTML.
 PHP7 was released in December 2015 ahead of deadlines and its
performance has grown substantially. Totally different architecture sits in
its kernel, so it changes the way how the interpreted code is being
processed on operation system level, and this actually causes this increase
in performance.
 There are performance accelerators available for PHP. For example,
Facebook came up with HipHop, a compiler of PHP into C which then
turned into executable files. Eventually, HipHop project came up with a
virtual machine transforming PHP script into bytecode and doing its own
internal performance optimization. There are also such solutions as APC,
ionCube, Turck MMCache, Zend Opcache, XCache etc.
 Websites powered by PHP: Facebook, WordPress, Wikipedia, Mailchimp,
Flickr, Yahoo!, Tumblr etc.

Cons of PHP

 When someone claims that they know PHP, it’s hard to


assess their level of development skill, so you’ll need to dig
deeper. PHP is so easy to learn on the basic level that
people without proper computer science background could
go and start developing, not knowing much about
algorithms, time complexity, application performance
optimization, advanced database querying, systems
scalability and other important aspects.
 It’s not as cross-platform as some of its competitors. The
language is compatible with UNIX based OS and Windows
OS.
Python

Pros of Python

 It requires less time to develop than, for instance, in Java,


as programs are shorter. So faster development and also
deeper prototyping would give you a competitive
advantage.
 Python has a quite simple syntax and easy-to-use data
structures.
 It performs well across different platforms.
 The language has good scalability.
 Apps powered or supported by Python include Instagram,
Pinterest, Django, Google, NASA, Yahoo, etc. You can
also check out more organizations using Python.

Cons of Python

- Performance could be better. Programs in Python are slower than in Java, for example. This is
obviously because it is one of the interpreted languages, which are normally slower than
compiled languages.

Ruby

According to Stack Overflow 2015 Developer Survey, Ruby is the technology which pays best in
Western Europe, which says a lot about its adoption scale.

Pros of Ruby

• Ruby prefers convention over configuration which makes applications easier to develop and
understand. Clear syntax makes the programming process much faster and more efficient.

• RoR framework has very simple structure, it’s easy for developers.

• Don’t Repeat Yourself, or DRY Principle. By not writing the same information over and over
again, the code is more maintainable, more extensible, and less buggy.

• You can develop MVP very fast on Ruby, it takes less time than on other languages.

• It has big development community.


• Testing plays a big role in development. Minitest library goes together with Ruby, so when you
develop something, it’s ready for testing. As a result, you get a neat secure product. There’s also
a very powerful testing framework for ROR called RSpec.

• Platforms that are supported by Ruby include Hulu, Shopify, Twitter, Scribd, Crunchbase,
Groupon, etc.

• There are many libraries, gems for any case, so when you are writing the code, you can use a
ready-made solution, so you don’t need to write it from scratch. The main repository contains
over 100,000 gems. [Link]

Cons of Ruby

- The performance is not as fast as on PHP or JavaScript.

- As it’s the technology that pays really well, development might turn out to be more expensive
than in other languages.

Java

Java Pros

- The core value proposition of the Java platform says “Write once, run anywhere”. So the most
important promise of Java technology is that you only have to write your application once and
then you’ll be able to run it anywhere. JVM is a universal engine, you can use it for anything, it
will work everywhere. It’s the most cross-platform language.

- It was arguably built with security in mind, so security features are one of
Java’s advantages.
- It has a big and dedicated development community.
- Outstanding performance.

Java Cons

- Bigger projects can be difficult to compile and build.

- Development is more expensive than in PHP or Python.

If you are still sitting on the fence with your choice, go through this fun flowchart and find out
which language is better for your product. And remember, you just need to find a good team with
talented developers. Then no matter which programming language you go for, you can be
confident in the final result.

T2.5) Common web programming interfaces

Application program interface (API)


An application program interface (API) is a set of routines, protocols, and tools for building
software applications. Basically, an API specifies how software components should interact.
Additionally, APIs are used when programming graphical user interface (GUI) components. A
good API makes it easier to develop a program by providing all the building blocks. A
programmer then puts the blocks together.

A web API is an application programming interface (API) for either a web server or a web
browser. It is a web development concept, usually limited to a web application's client-side
(including any web framework being used), and thus usually does not include web server or
browser implementation details such as SAPIs or web browser engine APIs unless publicly
accessible by a remote web application.

A web framework (WF) or web application framework (WAF) is a software framework that is
designed to support the development of web applications including web services, web resources,
and web APIs.

Server Application Programming Interface (SAPI) is the direct module interface to web servers
such as the Apache HTTP Server, Microsoft IIS, and Oracle iPlanet Web Server.

1. Server Application Programming Interface (SAPI)

SAPI is the direct module interface to web servers such as:

- Apache HTTP Server

- Microsoft IIS

- Oracle iPlanet Web Server

2. CGI - Common Gateway Interface

CGI is the abbreviation of Common Gateway Interface.

It is a specification for transferring information between a World Wide Web server and a CGI
program.

A CGI program is any program designed to accept and return data that conforms to the CGI
specification.

CGI programs can be written in any programming language, including:

-C

- Perl
- Java

- Visual Basic

3. What is CGI?

- The Common Gateway Interface (CGI) is a set of standards that define how information is
exchanged between the web server and a custom script.

- The CGI specifications are currently maintained by the NCSA.

- NCSA defines CGI as a standard for external gateway programs to interface with information
servers such as HTTP servers.

- The current version is CGI/1.1 and CGI/1.2 is under progress.

CGI programs are the most common way for Web servers to interact dynamically with users.
When the user fills out a form on a Web page and sends it to the server, it is often passed to a
CGI program for processing. This way, the user can get immediate feedback, such as a "Thank
you for filling out the form" message or a dynamically created Web page based on the user's
input.

Client-side solutions, such as Java applets and JavaScript scripts, can also be used to create
dynamic Web pages. These technologies are more efficient than CGI because they do not require
the client to communicate with the server in order to produce a new Web page. However, they
are not as powerful as CGI programs.

CGI programs are usually written in C, C++, Java, or Perl. They are stored in a special directory
on the server called the CGI-bin. When a CGI program is executed, the Web server creates a new
process to run it. This is a relatively expensive operation, which can lead to slow performance on
busy Web servers. To avoid this problem, some Web servers use a special API (Application
Programming Interface) such as ISAPI or NSAPI, or they use Java servlets.

Web Browsing

When you click on a hyperlink to browse a particular web page or URL:

- Your browser contacts the HTTP web server and demands the URL, i.e., filename.

- Web Server will parse the URL and will look for the filename. If it finds the requested file then
web server sends that file back to the browser otherwise sends an error message indicating that
you have requested a wrong file.
- Web browser takes response from web server and displays either the received file or error
message based on the received response.

However, it is possible to set up the HTTP server in such a way that whenever a file in a certain
directory is requested, that file is not sent back; instead it is executed as a program, and produced
output from the program is sent back to your browser to display.

The Common Gateway Interface (CGI) is a standard protocol for enabling applications (called
CGI programs or CGI scripts) to interact with Web servers and with clients. These CGI programs
can be a written in Python, PERL, Shell, C or C++ etc.

CGI Architecture Diagram

The following simple program shows a simple architecture of CGI –

You might also like