SD1230 - Weebly

Download Report

Transcript SD1230 - Weebly

SD1230
Unit 3
Under the Hood
Objectives
• During this unit, we will cover the following
course objectives:
– Describe how a computer program is compiled or
interpreted from scratch.
– Describe the differences and similarities of
desktop, website, and mobile technology.
– Describe various ways in which programs and data
are structured.
Learning Outcomes
• Completing this unit should help enable you
to:
– Identify typical computer languages with
examples.
– Explain the role of a compiler.
– Explain how interpreted code differs from
compiled code.
– Identify application development platforms for
desktop and mobile application development.
– Describe how data is stored and accessed.
Learning Outcomes (cont.)
– Explain how code is broken down.
– Explain the implications of computer resources,
including processor, memory, disk space, and
network, for application design.
– Identify the various operations that can be
performed in a program.
– Describe various techniques used to design an
application.
Top-Down Processing
• How things used to be
done
• All code is loaded into
memory
Resource Consumption
Drawbacks to Top-Down Processing
• Hard to properly test
code until it is finished
• Testing individual parts
is difficult
• Hard to find bugs
Breaking Up Code
• Advantages:
– It is easier to write small
components.
– You can test earlier and
more often.
– Debugging is easier.
– Code reuse is possible.
– You can add features
more easily.
Run Code More Than Once
• Makes code smaller and
more responsive
• Code is easier to read.
• Code is more flexible.
Calling the Code
How to Break Up Code
• Code is broken into two structures:
– The statement
– Function or procedure
Statements
• An instruction that does one of two
things:
– Do something
– Wait
Examples of Statements
Multiple Statements
Functions
• Group statements into chunks
How Code Can Be Stored
•
•
•
•
•
•
•
•
•
•
Paper punch cards
Magnetic tape reels
Magnetic cassettes
Floppy disks
Hard drives
Networked systems
CDs
DVDs
Flash drives
Internet distribution
How Data Is Stored – Binary
File Size
Program Code
• Plain text (interpreted)
– JavaScript
– VBScript
• Compiled
– Visual Basic
– C++
Programming Process
Compiled Code
Operators
•
•
•
•
•
Arithmetic
Assignment
Comparison
Logical
String
Arithmetic Operators
Operator
Description
Example
Result
+
Addition
If x = 6
X+4
10
-
Subtraction
If x = 6
X–2
4
*
Multiplication
If x = 6
X*2
12
/
Division
If x = 6
X/3
2
++
Increment (add
one)
If x = 6
X ++
7
--
Decrement
(subtract one)
If x = 6
X --
5
÷
Modulus (division
remainder)
7÷2
10÷4
12÷6
1
2
0
Assignment Operators
Operator
Example
Is Equivalent to…
=
X=6
X=Y
X=6
X=Y
+=
X += y
X=X+Y
-=
X -= y
X=X-Y
*=
X *= y
X=X*Y
/=
X /= y
X=X/Y
÷=
X ÷= y
X=X÷Y
Comparison Operators
Logical Operators
Operator
Description
&&
And
Example
X=7
Y=2
(x < 12 && Y >1)
In English, the preceding states “X is
less than 12, Y is greater than 1.”
X=7
Y=2
(x < 12 && Y <1)
returns false
||
Or
X=6
Y=1
(x == 6 || Y ==5)
Returns true
In English, the preceding states “X is
equal to 5, and Y is equal to 5.”
X=6
Y=1
(x == 5 || Y ==5)
returns false
X=6
Y=1
(x == 6 || Y ==1)
returns true
Logical Operators
Operator
Description
!
Not
Example
X=6
Y=3
! (X == Y)
returns true
In English, the preceding states
“X is not equal to Y.”
X=3+3
Y=4+2
! (X == Y)
returns false
String Operators
How Data Is Stored and Accessed
• Files
• Databases
Databases
• Data is stored in tables.
– Columns
– Rows
• Helps reduce the amount of data stored by
limiting repeated information
• Allows fast retrieval through queries
Types of Mobile Applications
•
•
•
•
•
SMS
Mobile websites
Mobile Web widgets
Mobile Web applications
Native applications
SMS Messages
Pros
• They work on any mobile
device nearly
instantaneously.
• They’re useful for sending
timely alerts to the user.
• They can be incorporated
into any Web or mobile
application.
• They can be simple to set
up and manage.
Cons
• They’re limited to 160
characters.
• They provide a limited textbased experience.
• They can be very expensive.
Mobile Websites
Pros
• They are easy to create,
maintain, and publish.
• They can use all the same
tools and techniques you
might already use for
desktop sites.
• Nearly all mobile devices
can view mobile websites.
Cons
• They can be difficult to
support across multiple
devices.
• They offer users a limited
experience.
• Most mobile websites are
simply desktop content
reformatted for mobile
devices.
• They can load pages slowly
because of network latency.
Mobile Web Widgets
Pros
• They are easy to create,
using basic HTML, CSS, and
JavaScript knowledge.
• They can be simple to
deploy across multiple
handsets.
• They offer an improved user
experience and a richer
design, tapping into device
features and offline use.
Cons
• They typically require a
compatible widget platform
to be installed on the
device.
• They cannot run in any
mobile Web browser.
• They require learning
additional proprietary, nonWeb-standard techniques.
Mobile Web Applications
Pros
Cons
• They are easy to create, using
basic HTML, CSS, and
JavaScript knowledge.
• They are simple to deploy
across multiple handsets.
• They offer a better user
experience and a rich design,
tapping into device features
and offline use.
• Content is accessible on any
mobile Web browser.
• The optimal experience might
not be available on all
handsets.
• They can be challenging (but
not impossible) to support
across multiple devices.
• They don’t always support
native application features,
like offline mode, location
lookup, file system access,
camera, and so on.
Native Applications
Pros
• They offer a best-in-class
user experience, offering a
rich design and tapping into
device features and offline
use.
• They are relatively simple to
develop for a single
platform.
• You can charge for
applications.
Cons
• Developing, testing, and
supporting multiple device
platforms is incredibly
costly.
• They require certification
and distribution from a
third party that you have no
control over.
• They require you to share
revenue with one or more
third parties.
Mobile Application Media Matrix
Application Context
Mobile Information Architecture
Mobile Information Architecture
Guidelines
• Keep it simple.
• Limit opportunities for mistakes.
• Confirm the path by teasing content.
Site Maps
Clickstreams
Process Flow Diagram
Wireframes
Paper Prototypes
Summary
• In this unit, we covered the following topics:
– Top-down processing
– Statements
– Functions
– Interpreted vs. compiled code
– Operators
– Databases
– Mobile application types
– Designing for mobile
Source
• Fling, B. (2009). Mobile design and
development: Practical techniques for creating
mobile sites and Web apps. Sebastopol, CA:
O’Reilly Media, Inc.