october 23, 2014

25
June 17, 2022 1 June 17, 2022 June 17, 2022 Azusa, Azusa, CA CA Sheldon X. Liang Ph. D. Computer Science Computer Science at at APU APU Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/ CS 363 Web Programming CS 363 Web Programming

Upload: nova

Post on 05-Jan-2016

29 views

Category:

Documents


2 download

DESCRIPTION

Computer Science at APU. CS 363 Web Programming. Sheldon X. Liang Ph. D. October 23, 2014. Azusa, CA. 1. October 23, 2014. Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: October 23, 2014

April 20, 20231

April 20, 2023April 20, 2023 Azusa, CAAzusa, CA

Sheldon X. Liang Ph. D.

Computer ScienceComputer Science at at APUAPU

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

CS 363 Web ProgrammingCS 363 Web Programming

Page 2: October 23, 2014

April 20, 20232

A silent night … …

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 3: October 23, 2014

April 20, 20233

A silent night … …

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 4: October 23, 2014

April 20, 20234

In the beginning, our project is formless …

We’re planning GUI form first

Then we deign interface form, plan properties and Basic code …

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 5: October 23, 2014

April 20, 20235

After we got GUI form, programming …

Now we define interface, set properties and write Basic code …

We’re programming Project

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 6: October 23, 2014

April 20, 20236

What’s needed to bridge the gap between…

Planning Programming

VISION is our Golden Gate Bridge

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 7: October 23, 2014

April 20, 20237

Form Planning vs. Programming Blank-filling under Framework Declaration vs. Scope & Lifetime Incremental Building Blocks Menu and Dialog Boxes (sub-form) Self-defined Procedures (Function)

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

CS363 Web ProgrammingCS363 Web ProgrammingEvent-Driven VBEvent-Driven VB

Page 8: October 23, 2014

April 20, 20238

Project Planning vs. Programming

Two kinds of structures (seq / sel)

Four kinds of controls

Three kinds of data

One kernel in mind: you do less but re-use

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 9: October 23, 2014

April 20, 20239

Project Planning vs. Programming

Controller controls

Four kinds of controls appearing on Forms Mute controls

Controlled controls

Contributor controls

They will do nothing dynamically, just display information. You do not need to consider them anymore in programming.

They not only do a lot of things, but also stimulate other controls to react. You need to give careful consideration in coding

They are passively affected by other controls and provide main showcase for calculation. You need to put data for display

They are happy to join others’ calculation by contributing their data. You need to pick data from them for calculation

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 10: October 23, 2014

April 20, 202310

Project Planning vs. Programming

Controller

Four kinds of controls appearing on Forms Mute

Controlled Contributor

Group Box and Most Labels

It only needs its “.Text” property, never needs a ”.Name” property, that is to say, you even do not need to give a name to it.

In your code, you won’t do anything.

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 11: October 23, 2014

April 20, 202311

Project Planning vs. Programming Four kinds of controls appearing on Forms

Most Buttons

It needs not only its “.Text” property, but also a serious “.Name” property, this is because some auto-generated code is strongly tied up with it.

Double-click will start your programming.

Mute

Controlled Contributor

Controller

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 12: October 23, 2014

April 20, 202312

Project Planning vs. Programming Four kinds of controls appearing on Forms

Double Click to startYour serious name should be: orderBtn

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 13: October 23, 2014

April 20, 202313

Project Planning vs. Programming Four kinds of controls appearing on Forms

Some Labels and TextBoxes

It usually has an empty “.Text” property. It needs a serious “.Name” property, and a variable for storing datum. Finally it is required to put datum back. i.e.,

totalLabel (name), totalDecimal (variable)

totalLable.Text = totalDecimal.toString()

Mute

Controlled Contributor

Controller

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 14: October 23, 2014

April 20, 202314

Project Planning vs. Programming Four kinds of controls appearing on Forms

Text Box, Radio and Check Box

It usually has an companied “.Text” property. It needs a serious “.Name” property, variable (or constant) related to it. Generally it just contribute something for calculation, i.e.,

quantityTextBox (name), quantityInteger (variable)

quantityInteger = Integer.Parse (quantityTextBox.Text)

Mute

Controlled Contributor

Controller

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 15: October 23, 2014

April 20, 202315

Project Planning vs. Programming

Inner Identifier .Name property

Three kinds of data Appearance .Text property

Variable/Const store data at run time

This property is for users to look at while using the form, so brief, exact, and precise TEXT will be good for them.i.e., Order Coffee, Clear, Exit

This property is for designers to identify controls while design form and programming, so easy to remember will be great.i.e., quantityTextBox (or quantityTB), totalLabel (or totalLB)

This is for data storage in calculation, pickup and conversion, so data type postfix to the variable will be good for programmers.i.e., quantityInteger, totalDecimal, taxDecimal, TAX_RATE_Decimal

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 16: October 23, 2014

April 20, 202316

Project Planning vs. Programming

Inner Identifier

Three kinds of data Appearance

Variable/ConstAll information appearing on the form

Their purpose appearing on the form is to prompt users to know the meaning, so that they are guided to further operation. i.e.,

.Text properties Bill Form, Coffee Selection, Cappuccino, Espresso, Latte, Iced Latte, Iced Cappuccino, Your Order, Quantity, takeout, Discount15%, Oder, Total Tax, Discount, Total Due, Enjoy yourself (Clear)

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 17: October 23, 2014

April 20, 202317

Project Planning vs. Programming

Inner Identifier

Three kinds of data Appearance

Variable/Const

Every control has an inner identifier

Their purpose is to let form designer and programmer use their various properties through the .Name, but for mute controls, just take the default one.

cappuccinoRadioButton

espressoRadioButton

quantityTextBox

orderButton

quantityTextBox

quantityTextBox

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 18: October 23, 2014

April 20, 202318

Project Planning vs. Programming

Inner Identifier

Three kinds of data Appearance

Variable/Const

Contributor & Controlled controls need variables to hold data

Their purpose is to let programmer hold data for calculation, conversion, and other use

quantityInteger

totalDecimal

taxDecimal

discountDecimal

totalDueDecimal

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 19: October 23, 2014

April 20, 202319

Form Planning vs. Programming Blank-filling under Framework Declaration vs. Scope & Lifetime Incremental Building Blocks Menu and Dialog Boxes (sub-form) Self-defined Procedures (Function)

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

CS363 Web ProgrammingCS363 Web ProgrammingEvent-Driven VBEvent-Driven VB

Page 20: October 23, 2014

April 20, 202320

Blank-filling under framework A Perfect VISION Form

Math description

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 21: October 23, 2014

Blank-filling under framework A Perfect VISION Form

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Page 22: October 23, 2014

April 20, 202322

Form Planning vs. Programming Blank-filling under Framework Incremental Building Blocks Menu and Dialog Boxes (sub-form) Self-defined Procedures (Function) Declaration vs. Scope & Lifetime

CS363 Web ProgrammingCS363 Web ProgrammingEvent-Driven VBEvent-Driven VB

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 23: October 23, 2014

Incremental Building Blocks Simple Form and Brief Operation

Simple Form

Menu Window and Integrated Forms

Father Window and Common Dialog Box

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 24: October 23, 2014

Declaration vs. Scope & Lifetime

Variable Scope accessible privilege

Variable lifetime live an actual life

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/

Page 25: October 23, 2014

April 20, 202325

That is all

Thank you very much!

Questions?

Computer Science & Software EngineeringComputer Science & Software EngineeringCS363 Web ProgrammingCS363 Web Programming: Event-Driven Programming: Event-Driven Programming

Azusa Pacific University, Azusa, CA 91702, Tel: (800) 825-5278 Department of Computer Science, http://www.apu.edu/clas/computerscience/