HTML Architecture A Novel Development System HANDS An Approach For Web Development
HTML Architecture A Novel Development System HANDS An Approach For Web Development
I. INTRODUCTION
Web development has become one of the most in-demand
skills. To meet this need, the addition and retention of
students in this field is critical. Web development has a steep
learning curve and many obstacles. One obstacle is getting
students developing HyperText Markup Language (HTML),
Fig. 1. HANDS primitives.
JavaScript (JS), and Cascading Style Sheets (CSS)
applications that include server side processing.
The typical approach to web development training includes
After developing HANDS, the question was asked: If the
a brief introduction to HTML. Very quickly courses introduce
primitive, foundational elements can deliver any type of web
a framework that hides the complexities of front-end and
application, why introduce libraries that hide functionality and
backend (server side) development. Often this is to give
increase complexity? The position of this paper is to build an
students confidence that they can create complex web
architecture where the focus is the HTML page while only
applications. The downfall of this approach, students learn the
introducing libraries after understanding the concepts
details of the framework and not the in-depth details of the
delivered in such libraries. With this approach, when issues
foundational elements of web applications. As shown in
occur later in the development phase, the developers have the
figure 1, the primitives of HANDS include HTML, JS, CSS,
foundation to find and understand the root problems and
and Node.js.
provide solutions.
This is compounded when the student enters into a
In this paper, the focus is on HTML, CSS, and JS. A basic
corporate software development position. The majority of
website is created and studied. An understanding of the basic
companies have a well-established framework (open source or
elements are required before moving on. The goal is to
propriety) for development. This has formed a void in the in-
propose HANDS as an approach to learning web development
and to provide a foundation for enterprise development.
This work was supported in part by Sullivan University and Chippewa
Software Technology. II. HYPERTEXT MARKUP LANGUAGE
HTML, short for HyperText Markup Language, is the
authoring language used to create documents on the World
Wide Web (www). Initially, HTML was designed to publish
Brian Carter is with Sullivan University, College of Information and
Computer Technology, Louisville, KY 40205 USA (e-mail: documents, much like one would publish a journal of articles.
[email protected]) and is with Chippewa Software Technology, La HTML defines the structure and layout of a Web document
Grange, KY 40031 USA (e-mail: [email protected]). by using a variety of tags and attributes. A web browser can
Fig. 2. HANDS basic HTML template. Fig. 3. HANDS basic template with JavaScript.
The text between <html> and </html> describes the web As shown, JS is added to the HANDS template by including
page, and the text between <body> and </body> is the visible the <script> tag. The document references the HTML page.
page content. The markup text '<title>This is HANDS</title>' GetElemementById references the tag with the id of “p1”
defines the browser page title that shows up in the tab. The which is the <p> tag. This basic js example shows the
tag <p> is for a paragraph and is displayed on the page. fundamentals on how an HTML page can be manipulated.
An online tool to share code examples and provide an easy This is a very powerful concept and it is delivered without the
starting point for students to practice is jsfiddler.net. The code need for a framework. See working example:
in figure 2 has been placed in a fiddle for readers to run: http://jsfiddle.net/ briancarter/bsxnx3qL/. There are many
http://jsfiddle.net/briancarter/fbqn0kou/. tutorials and examples on the web [3] for in-depth study of JS.
HTML documents imply a structure of nested HTML
elements. These are indicated in the document by HTML tags, IV. CASCADING STYLE SHEETS
enclosed in angle brackets: <p>. In the example, the extent of Web browsers can also use Cascading Style Sheets (CSS) to
an element is indicated by a pair of tags: a start tag <p> and an define the look and layout of the HTML page. Think of CSS
ending tag </p>. The text content of the element, if any, is as the artist of web development; changing the color of
placed between these tags. Tags may also enclose additional elements, the font sizes, and the layout. The W3C, maintainer
tags, including a mixture of tags and text. An example is the of both the HTML and the CSS standards, encourages the use
bold tag <b> which is included inside the paragraph tag <p>. of CSS [5].
This indicates further, nested, elements, as children of the CSS is designed primarily to enable the separation of
parent element. A full tutorial on HTML is beyond the scope document content from document presentation, including
of this paper. A good reference is w3schools.com[3] for elements such as the layout, colors, and fonts [6]. This
additional tutorials and examples. separation can improve content accessibility, provide more
91
Authorized licensed use limited to: Polytechnic University of Bucharest. Downloaded on June 13,2023 at 11:37:05 UTC from IEEE Xplore. Restrictions apply.
flexibility and control in the specification of presentation Fig. 5. HANDS basic template as shown in web browser.
characteristics, enable multiple HTML pages to share
formatting by specifying the relevant CSS in a separate .css For optimization and for separation of concerns, the JS and
file, improve team dynamics by allowing separation of CSS code is typically consolidated into separate external files.
responsibilities, reduce complexity and repetition by reuse of This allows the browser to cache the content more effectively.
common presentation formats, and reduce maintenance change This also separates concerns have the three fundamental
impacts. aspects of web development in their own maintainable files.
Extending the example from figure 3, the use of CSS is For HANDS, the approach is to keep the code together and
shown in figure 4. The <style> tag is included in line to as close to the area of responsibility as possible. This provides
change the color of the hello paragraph. There are many the students a single file to understand the elements and how
features and functions for CSS and additional training material they interact. Once the students understand this concept, the
can be found on the web [3]. best practice of separation of individual files can be applied.
92
Authorized licensed use limited to: Polytechnic University of Bucharest. Downloaded on June 13,2023 at 11:37:05 UTC from IEEE Xplore. Restrictions apply.
backend application which returns JSON data. The full console.log('Server running at http://127.0.0.1:8080/');
enterprise framework is open source and can be studied in
detail [9].
Fig. 7. HANDS basic server template: app.js.
The next step is to create a front-end page to call the back-
end server. Create a page called “index.html” as shown in
figure 8. The page includes a reference to jQuery to simplify
Router Entry
the support of AJAX on different browsers. The page has a
JSON div placeholder for the data retrieved from the service
apiv1.js Request
(“teamlist”). An inline JavaScript section calls the service,
Yes builds the html, and injects the html into the “teamlist” div.
Route
process app.js
Exists
<!DOCTYPE html>
No <html lang="en">
Response <head>
Asset
Asset
(html, js, css, image) <title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
Fig. 6. HANDS basic template as shown in web browser. </script>
</head>
The back-end application is shown in figure 7. In the <body>
Node.js code, a server is created and listening on localhost
<p>Team List</p>
port 8080. When the server receives a request, it looks at the
url to determine if it is the API call (/api/v1/teams) or a <div class="teamlist"></div>
request for the root site (/); this is an example of a basic router. <script>
The router will process the API call and return back a JSON var html = '';
response that has an array with two items. The request for the $.ajax({
root page will stream the “index.html” page to the user.
url: '/api/v1/teams',
type: 'GET',
var http = require('http');
success: function(data) {
var url = require('url');
$.each(data, function (i, value) {
var path = require('path');
html += '<p>' + value.team + '</p>';
var fs = require('fs');
});
$('.teamlist').html(html);
http.createServer(function (req, res) {
}
var uri = url.parse(req.url).pathname;
});
switch(uri) {
</script>
case '/api/v1/teams':
</body>
res.writeHead(200, {'Content-Type': 'application/json'});
</html>
res.end('[{"team":"Team A"}, {"team":"Team B"}]');
break;
case '/': Fig. 8. HANDS basic html template: index.html.
93
Authorized licensed use limited to: Polytechnic University of Bucharest. Downloaded on June 13,2023 at 11:37:05 UTC from IEEE Xplore. Restrictions apply.
application processes the request and returns back the JSON <html lang="en">
<head>
data with Team A and Team B. The page successfully
<title></title>
receives the data and injects the html. The final page lists both <script
teams. src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
</script>
</head>
<body>
<p>Team List</p>
<div class="teamlist"></div>
<script>
var html = '';
$.ajax({
url: '/api/v1/teams',
type: 'GET',
success: function(data) {
$.each(data, function (i, value) {
html += '<p>' + value.team + '</p>';
});
console.log(html);
$('.teamlist').html(html);
}
});
Fig. 9. HANDS basic template as shown in web browser. </script>
94
Authorized licensed use limited to: Polytechnic University of Bucharest. Downloaded on June 13,2023 at 11:37:05 UTC from IEEE Xplore. Restrictions apply.
[6] "What is CSS?”, World Wide Web Consortium. Retrieved December
2010, Retrieved from http://www.w3.org/standards/webdesign/
htmlcss#whatcss, November 1, 2014.
[7] Carter, Brian (2014). HTML Educational Node.js System (HENS)
[8] An applied system for web development, To be Published. Retrieved
from www.virtualcict.org.
[9] HANDS open source code. Retrieved from https://github.com/
ChipSoftTech/HANDS.
[10] Node.js Documentation. Retrieved from http://nodejs.org.
95
Authorized licensed use limited to: Polytechnic University of Bucharest. Downloaded on June 13,2023 at 11:37:05 UTC from IEEE Xplore. Restrictions apply.