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 OperatorDescriptionExampleResult +AdditionIf x = 6 X SubtractionIf x = 6 X – 2 4 *MultiplicationIf x = 6 X * 2 12 /DivisionIf x = 6 X / Increment (add one) If x = 6 X Decrement (subtract one) If x = 6 X -- 5 ÷Modulus (division remainder) 7÷2 10÷4 12÷
Assignment Operators OperatorExampleIs Equivalent to… =X = 6 X = Y X = 6 X = Y +=X += yX = X + Y -=X -= yX = X - Y *=X *= yX = X * Y /=X /= yX = X / Y ÷=X ÷= yX = X ÷ Y
Comparison Operators
Logical Operators OperatorDescriptionExample &&AndX = 7 Y = 2 (x 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 ||OrX = 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 OperatorDescriptionExample !NotX = 6 Y = 3 ! (X == Y) returns true In English, the preceding states “X is not equal to Y.” X = Y = ! (X == Y) returns false
String Operators
How Data Is Stored and Accessed Files 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 text- based 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, non- Web-standard techniques.
Mobile Web Applications Pros 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. Cons 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
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.