Static vs. Dynamic Relationships CIS 480 System Analysis and Design.

Slides:



Advertisements
Similar presentations
Chapter 8. Operator Overloading Operator overloading gives the opportunity to redefine C++ Operator overloading refers to redefine C++ operators such.
Advertisements

 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Dr. Liers, Dr. Ritter, Tian --PR MC SS02-- Hands-On Lab: Mobile.
Programming Based on Events
 2002 Prentice Hall. All rights reserved. 1 Chapter 6 - Methods Outline Note: Inconsistent with textbook subsection numbering […] 6.14Recursion 6.15 Example.
Event Notification Pattern Dr. Neal CIS 480. Event Notification Pattern When a class abc has something happening that class xyz needs to know about you.
Carnegie Mellon University MSCF1 C#/.NET Basics 2 Some code is from “C# in a Nutshell” and “Programming C#”
1 Chapter 26 D&D – Graphics Outline 26.1 Introduction 26.3 Graphics Contexts and Graphics Objects 26.4 Color Control 26.5 Font Control 26.6 Drawing Lines,
 2002 Prentice Hall. All rights reserved. 1 Chapter 11 – Exception Handling Outline 11.1 Introduction 11.2 Exception Handling Overview 11.3 Example: DivideByZeroException.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Chapter 15 – Inheritance, Virtual Functions, and Polymorphism
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Working with Unmanaged Code.
Domain Model—Part 4A: Special associations - Composition.
Object Oriented Programming Graphical User Interfaces Dr. Mike Spann
 2002 Prentice Hall. All rights reserved. 1 Week 2: Methods Questions about last week’s revision –C#.NET –.NET Framework –sequence, selection, repetition.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization Practical Course C# / DirectX WS 05/06 Introduction.
Session 08: Architecture Controllers or Managers Graphical User Interface (GUI) FEN AK - IT Softwarekonstruktion.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Computer Science 101 Web Services. Alsos Search for Niels Bohr.
1 CS1120: Recursion. 2 What is Recursion? A method is said to be recursive if the method definition contains a call to itself A recursive method is a.
Carnegie Mellon University MSCF1 C#/.NET Basics 2 Some code is from “C# in a Nutshell”
Sample Application Multi Layered Architecture (n-tier): –Graphical User Interface (GUI): Forms, components, controls The Visual Designer in Visual Studio.
Case study Students. Array of objects Arrays can hold objects (ref to objects!) Each cell in an array of objects is null by default Sample: from student.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
Inheritance & Dynamic Binding. Class USBFlashDrive We better introduce a new class USMBFlashDrive and save() is defined as a method in that class Computer.
Jozef Goetz,  2002 Prentice Hall. All rights reserved. Credits:  Pearson Education, Inc. All rights reserved.
 2002 Prentice Hall. All rights reserved. 1 Chapter 8 – Object-Based Programming Outline 8.1 Introduction 8.2 Implementing a Time Abstract Data Type with.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Creating a Multiple-Form Interface.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
MIT AITI 2004 – Lecture 13 Abstract Classes and Interfaces.
PseudocodeFORTRAN (original) INPUT number INPUT divisor intermediate = divisor intermediate
[ServiceContract] public interface IJokeOfTheDayService { [OperationContract] string GetJoke(int jokeStrength); }
1 9/6/05CS360 Windows Programming CS360 Windows Programming.
Static. 2 Objectives Introduce static keyword –examine syntax –describe common uses.
Architecture Multi Layered Architecture (n-tier): Application: Model Controllers Database Access Graphical User Interface (GUI): Forms, components, controls.
Sit-In Lab 2 - OOP Restaurant.  Manage a restaurant and perform these types of queries: Assign a favorite table to a specific group Assign the lexicographically-smallest.
Using ADO.Net to Build a Login System Dr. Ron Eaglin.
1 Class Chapter Objectives Use a while loop to repeat a series of statements Get data from user through an input dialog box Add error checking.
1NetBeans Tutorial Using the “Properties” menu, name the List “List1” and the button “Button1”. NetBeans Tutorial6.
Classes - Intermediate
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
Exercise 6 Introduction to C# CIS Create a class called ParseDates that will parse a formatted string containing a date into separate integers.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
.Net training In gandhinagar 16/10/2016.
Windows form programming. namespace MyNamespace { public class MyForm : System.Windows.Forms.Form { public MyForm() { this.Text = "Hello Form"; }
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Staples are our staple Building upon our solution.
GUI Programming Prepared by: Ahmad Ramin Rahimee Assistant Professor ICTI.
Object-Oriented Programming
C# Object-Oriented Program
Chapter 7 - Methods Outline Note: Inconsistent with textbook subsection numbering […] 7.13 Recursion […]
Object Oriented Programming
CS360 Windows Programming
Chapter 6 - Methods Outline 6.1 Introduction 6.2 Program Modules in C# 6.3 Math Class Methods 6.4 Methods 6.5 Method Definitions 6.6 Argument.
UML & Programming Martin Fowler.
Variables and Their scope
Program Modules in C# Modules The .NET Framework Class Library (FCL)
Assignment 7 User Defined Classes Part 2
Java Lesson 36 Mr. Kalmes.
Code Animation Examples
Class Everything if Java is in a class. The class has a constructor that creates the object. public class ClassName private Field data (instance variables)
Chapter 8 – Object-Based Programming
Web Service.
6. WinForms 2003 C# GUI - Basics.
JAVA CLASSES.
Method exercises Without IF
Subtype Substitution Principle
Presentation transcript:

Static vs. Dynamic Relationships CIS 480 System Analysis and Design

Domain Classes (business domain) 11..* Static Association or (problem domain)

Design Classes (solution domain)

Order Class public class Order { private OrderLine[] orderline = new OrderLine[5]; private int orderNumber; public Order(int o) { orderNumber = o; for (int i = 0; i < 5; i++) orderline[i] = null; } public void addOrderLine(int line, string d, double q, double p) { orderline[line] = new OrderLine(this, d, q, p); } public string[] getLines() { string[] returnS = new string[3]; int i = 0; while (orderline[i] != null) { returnS[i] = orderline[i].DESCRIPTION + ", " + orderline[i].QUANTITY + ", " + orderline[i].PRICE; i++; } return returnS; }

OrderLine Class public class OrderLine { private string description; private double quantity; private double price; private Order order; public OrderLine(Order o, string d, double q, double p) { order = o; description = d; quantity = q; price = p; } public string DESCRIPTION { get { return description;} } public double QUANTITY { get { return quantity; } set { quantity = value; } } public double PRICE { get {return price; } set { price = value; } }

Form1 Class { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button btCreateOrder; private System.Windows.Forms.Button btOrderLines; private System.Windows.Forms.TextBox txtOrder; private System.Windows.Forms.TextBox txtOrderLines; private System.Windows.Forms.Button btListLines; private System.Windows.Forms.ListBox lstOrderLines; private System.Windows.Forms.Label lblStatic; private System.Windows.Forms.Label lblColumns; private System.Windows.Forms.Label lblLine; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; private System.Windows.Forms.Label lblStaticDesc; private System.Windows.Forms.Label lblDynamicDesc; private Order order; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // }

Form1 Class [ STAThread] static void Main() { Application.Run(new Form1()); } private void createOrderClick(object sender, System.EventArgs e) { order = new Order(2345); txtOrder.Text = "Order 2345 created"; } private void createOrderLinesClick(object sender, System.EventArgs e) { order.addOrderLine(0, "Boxes", 12, 1.25); order.addOrderLine(1, "Chairs", 2, 45.78); order.addOrderLine(2, "Table", 1, ); txtOrderLines.Text = "3 order lines created"; } private void listOrderLinesClick(object sender, System.EventArgs e) { string[] list = new string[5]; list = order.getLines(); lstOrderLines.Items.AddRange(list); } private void lblDynamicDesc_Click(object sender, System.EventArgs e) { }

User Interface

Dynamic Actions During Execution