Programming Paradigms, Software Architectural Patterns, and MVC CS 378 – Mobile Computing for iOS Dr. William C. Bulko.

Slides:



Advertisements
Similar presentations
An Introduction to Programming General Concepts. What is a program? A program is an algorithm expressed in a programming language. programming language.
Advertisements

Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Computers Are Your Future
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
High-Level Programming Languages
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
Visual Basic Introduction IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques.
Object-Oriented Analysis and Design
Chapter 7 Improving the User Interface
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
MVC pattern and implementation in java
High-Level Programming Languages: C++
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
CS 363 Comparative Programming Languages
Python Mini-Course University of Oklahoma Department of Psychology Day 2 – Lesson 6 Program Design 4/18/09 Python Mini-Course: Day 2 - Lesson 6 1.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
CS101 Introduction to Computing Lecture Programming Languages.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
Chapter 6 Programming Languages (1) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Programming Languages
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
Programming Logic and Design Seventh Edition Chapter 12 Event-Driven GUI Programming, Multithreading, and Animation.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
The language focusses on ease of use
Programming Logic and Design Seventh Edition
INLS 623– Stored Procedures
Coupling and Cohesion Rajni Bhalla.
Programming & Scratch.
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
CSCI-235 Micro-Computer Applications
Key Ideas from day 1 slides
CS101 Introduction to Computing Lecture 19 Programming Languages
An Introduction to Programming
Course: Introduction to Computers
Functions CIS 40 – Introduction to Programming in Python
Application Development Theory
Understand Windows Forms Applications and Console-based Applications
Ch > 28.4.
Computer Programming.
Software Programming J. Holvikivi 2014.
Programming Languages
Topics Introduction to Functions Defining and Calling a Void Function
Professor John Canny Spring 2004 March 5
and Program Development
Principles of Programming Languages
Topics Introduction to Functions Defining and Calling a Function
Overview of Programming Paradigms
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
Tonga Institute of Higher Education IT 141: Information Systems
An Introduction to Programming
Programming Languages and Paradigms
Tonga Institute of Higher Education IT 141: Information Systems
Model, View, Controller design pattern
Professor John Canny Spring 2003 March 12
ACM programming contest
Subprograms General concepts Parameter passing Functions
Presentation transcript:

Programming Paradigms, Software Architectural Patterns, and MVC CS 378 – Mobile Computing for iOS Dr. William C. Bulko

Programming Paradigms Functional Programming (1930s to present): all about the evaluation of mathematical functions and avoids state and mutable data.  Lambda calculus, logic programming, Lisp, Scheme, Haskell

Programming Paradigms Imperative Programming (1950s to 1970s): defines computation as statements that change a program state.  Think “verbs”  A variable contains a value, an assignment statement changes it  A print statements sends a value to output  A “go to” transfers control to another statement  Functions and subprograms not really emphasized: used for code reuse only  FORTRAN, COBOL, PL/1, Algol, Basic

Programming Paradigms Procedural Programming: similar to Imperative, but attention now turned to functions and subprograms (“procedures”)  “Modularizing” programs encouraged  Scoping is now important: state changes are localized within subprograms  Changes spanning multiple subprograms are communicated by passing parameters and return values

Programming Paradigms Structured Programming: focus is on making programs easier to write, debug, and understand  Proliferation of subprograms, block structures, and different kinds of statements  if vs. if-then-else, C-style for vs. “in”-style for, while vs. repeat loops  “go to” statements considered blasphemous  Pascal, C

Programming Paradigms Declarative Programming: defines computational logic without defining its control flow  Prolog, SQL Object-Oriented Programming: organizes programs as objects: data structures with attributes and methods together with their interactions.  C++, Java, Python Automata-Based Programming: a program, or part of a program, is treated as a model of a finite state machine or similar formal automaton.

Programming Paradigms Event-Driven Programming: control flow is determined by events, such as input from sensors or user actions (mouse clicks, key presses, etc.) or messages from other programs or threads  The notion is that the application sits, waiting for input from the user — which can come from many directions.  Event-driven programming is the dominant paradigm for graphical user interfaces and other applications that are centered on performing certain actions in response to user input.

Software Architectural Patterns Software Architectural Patterns are reusable approaches or solutions to problems in software design that show up frequently.  They act like templates on which you base your software  Software architectural patterns are conceptual, such as “peer-to-peer networking”.  Software architectures are actual implementations of a pattern, such as TCP/IP.

SW Architectural Pattern: Model-View-Controller Model-View-Controller is a software architectural pattern for implementing user interfaces.  It follows the event-driven paradigm for control flow.  It divides an application into three interconnected parts in order to separate internal structures from the way they’re presented to the user. Model  Consists of objects that encapsulate the data specific to the application  Defines the logic and computations that manipulate and process that data.

SW Architectural Pattern: Model-View-Controller View  Any object in an application that users can see. Main purpose: to display data from the model objects and enable editing of that data  View objects know how to draw themselves, and can respond to user actions  Provide consistency between applications  Multiple views of the same information is possible; for example, a bar chart for management and a table view for finance. Controller  Acts as an intermediary between view objects and model objects  Accepts input and converts it to commands for the model or view  Can also perform setup and coordinating tasks for an application and manage the life cycles of objects

MVC: Controller Model View Controller User manipulates (adds, changes) Controller: Interprets user actions made in view objects and communicates changes to the model to update the model’s state When model objects change, controller communicates changes to the view to change the view’s presentation

MVC: Model Model View Controller User Model: Tells the View when there has been a state change, causing the output from the View to be updated. Tells the Controller when there has been a state change, causing the Controller to change the set of commands available. updates

MVC: View Model View Controller User requests data View: Requests information from the model that it uses to generate output to the user

MVC (cont.) View User Note that the user never interacts directly with the model. uses manipulates (adds, changes) requests data presents updates Model updates Controller

Model-View-Controller (cont.)  The View presents a window with controls to the user  Any data that the user enters is sent to the Controller; for example, selecting an item such as “Notifications”.  The Controller updates the Model (i.e., stores the data in a data structure, updates objects, etc.)  The Model tells the View to display a different window  The Model also tells the Controller that the controls from the previous window no longer work, and there are new ones to pay attention to. Model-View-Controller is often used in Web applications and Mobile applications.