CS3220 Web and Internet Programming About Data Models

Slides:



Advertisements
Similar presentations
1 Security and Software Engineering Steven M. Bellovin AT&T Labs – Research
Advertisements

Object Oriented Software Development
Inner and Anonymous Classes Though you are captive in the OO paradigm, you can use inner classes and anonymous classes to get around this constraint and.
CS 111 – Oct. 20 Most essential skill in IT: problem solving using the computer –Telling the machine exactly what we want it to do. –Also: making sure.
1 Web Search Who are the different people often involved in making a computer or video game? 2 Web Search/Thinkin g What is programming? Why would.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA (I) Chengyu Sun California State University, Los Angeles.
CS320 Web and Internet Programming Web Application and MVC Chengyu Sun California State University, Los Angeles.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
Complex Numbers. Solve the Following 1. 2x 2 = 8 2. x = 0.
CS520 Web Programming Spring – Inversion of Control Chengyu Sun California State University, Los Angeles.
CS422 Principles of Database Systems Entity-Relationship Model
Chengyu Sun California State University, Los Angeles
CS3220 Web and Internet Programming More SQL
CS320 Web and Internet Programming SQL and MySQL
CS320 Web and Internet Programming Generating HTTP Responses
CS422 Principles of Database Systems Course Overview
Chengyu Sun California State University, Los Angeles
More on Java Generics Multiple Generic Types Bounded Generic Types
CS4450: Principles of Programming Languages
Lecturer CS & IT Department UOS MBDIN
JavaScript.
Warm-up 7-7.
Chengyu Sun California State University, Los Angeles
Lesson 4: Controlling Memory with Variables
Object Oriented Theory I
CS5220 Advanced Topics in Web Programming Spring – Web MVC
CS320 Web and Internet Programming Cookies and Session Tracking
CS320 Web and Internet Programming Expression Language (EL)
CS320 Web and Internet Programming Java Beans
CS320 Web and Internet Programming MVC Architecture
CS3220 Web and Internet Programming Cookies and Session Tracking
CS5220 Advanced Topics in Web Programming JavaScript Basics
CS2011 Introduction to Programming I Objects and Classes
CS2011 Introduction to Programming I Arrays (II)
Chengyu Sun California State University, Los Angeles
CS5220 Advanced Topics in Web Programming Spring – Web MVC
CS2011 Introduction to Programming I Loop Statements (II)
CS2011 Introduction to Programming I Methods (II)
CS2011 Introduction to Programming I Methods (I)
CS2011 Introduction to Programming I Arrays (I)
CS2011 Introduction to Programming I Multidimensional Arrays
Chengyu Sun California State University, Los Angeles
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming Expression Language (EL)
Chengyu Sun California State University, Los Angeles
See requirements for practice program on next slide.
Advisement Features in CSNS (II) Department Program
Chengyu Sun California State University, Los Angeles
CS2011 Introduction to Programming I Selections (I)
CS3220 Web and Internet Programming Cookies and Session Tracking
CS3220 Web and Internet Programming Expression Language (EL)
Rules and Tips for Good Web Programming (and Programming in General)
Chengyu Sun California State University, Los Angeles
CS3220 Web and Internet Programming SQL and MySQL
Rocky K. C. Chang September 11, 2018
Chengyu Sun California State University, Los Angeles
Software Development Chapter 1.
CS3220 Web and Internet Programming JavaScript Basics
CMPT 120 Lecture 2 - Introduction to Computing Science – Problem Solving, Algorithm and Programming.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
CS4540 Special Topics in Web Development Course Overview
CS4540 Special Topics in Web Development Introduction to .NET
CS4540 Special Topics in Web Development LINQ to Objects
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Computer Programming Tutorial
Presentation transcript:

CS3220 Web and Internet Programming About Data Models Chengyu Sun California State University, Los Angeles

Broadly speaking, the world consists of things and actions performed by things or on things

Things and Actions in Computer Programs Most of computer programs are created to help people solve problems in the real world (or in the case of video games, problems in imaginary worlds) Real World Computer Program Things Data Actions Actions (Operations)

Data and Operations in Programming Languages Values (a.k.a. Literals) Variables Structs Data Functions Methods Operations

Data and Operations in OO Languages Class { Fields Methods } Data Operations

Data and Operations in MVC A class that represents only data Model Displays the result of an operation View Controller Implements an operation

Importance of Data Modeling Data is half of your application If data is not modeled correctly, operations will be wrong no matter what you do

What's Wrong with the Code? List<String> surveys = new ArrayList<String>(); List<String> questions = new ArrayList<String>(); List<String> choices = new ArrayList<String>();

What's Wrong with the Code? public class Survey { String name; List<String> questions; List<String> choices; }

What's Wrong with the Code? public class Survey { String name; String question; List<String> choices; }

What's Wrong with the Code? public class Survey { String name; Map<String, List<String>> questions; }

Create Data Model Classes Look for nouns in the problem description Simple types (e.g. number, string, data/time) become fields Complex types (i.e. things that contain other things) become classes Add an id field when necessary If it passes the "English test", it's probably a good class