ITNP090 - Object Oriented Software Design

Size: px
Start display at page:

Download "ITNP090 - Object Oriented Software Design"

Transcription

1 In this practical, we will create a model for a part of the reservation system for a library. There are Book objects and an application object that creates and manipulates them. Two view objects in the visual interface allow users to track the status of a particular book: LibrarianView and BorrowerWishlistView. We will use the Observer Pattern to keep the views updated, and the Strategy Pattern to sort the books in a collection. Create the classes for Observer 1. Create new Java Modelling Project, with the name Practical3 2. To begin with, we will create the classes that we need. Refer to Practical 1 if you need a reminder to do these. 3. Add a new class called Book 4. Select the Book class, and add these attributes, with the types given after the colon (right click Book, New, Attribute): a. title : String b. authorsurname : String c. yearpublished : int d. isborrowed : boolean 5. Also add these operations, with no parameters, with visibility public, and the return types given after the colon (right click Book, New, Operation): a. checkin() : void b. checkout() : void c. tostring() : String 6. Add a constructor to Book (right click Book, New, Constructor). Give it the parameters: a. title : String b. authorsurname : String c. yearpublished : int 7. We will make use of Java s abstract Observable class. This implements the list of Observers for us, and provides methods to add, remove, and notify observers. Click on Book class, scroll down properties, and in the extends box, type java.util.observable 8. Add two more classes: LibrarianView and BorrowerWishlistView 9. To these two view classes: a. Left click on each and set the property implements to java.util.observer b. Add an operation update() - set its visibility to public, and give it the parameters: i. obs : java.util.observable ii. obj : Object 10. Once this is all done, your class diagram should look like this: 1

2 Adding source code to make it work You have now implemented the Observer pattern. The views implement the Observer interface, and can be registered as observers of a Book object. The Book can notify all its registered observers if and when it changes state. The only thing that s missing is some code to give the objects something useful to do and a demo of it working. 11. Double click on Book s constructor (<<create>> Book). The source code editor will open in the middle of the screen, with the constructor highlighted. public Book(String authorsurname, String title, int yearpublished){ } 12. Delete the content between the curly brackets {}, and enter the following (you can copy and paste): this.isborrowed = false; this.authorsurname = authorsurname; this.title = title; this.yearpublished = yearpublished; This will allow us to create a new Book object by specifying the title, author and publication year, and the new book will always default to being available (that is, not borrowed). 13. Now add the following code to the checkin() operation. As above, double click the operation name, and add the code between the curly brackets, before return: 14. Repeat (13) for checkout(): this.isborrowed = false; this.setchanged(); this.notifyobservers(); this.isborrowed = true; this.setchanged(); this.notifyobservers(); These two methods allow a Book object to be checked in and out of the library. Doing this will change its state from borrowed to not borrowed and back again. Once the state is changed, we will call the notifyobservers() method, which Book has inherited from the Observable abstract class, and it will take care of notifying any objects that have registered. (setchanged() is also needed before notifyobservers() in the Java implementation) 15. Now add the following code to the tostring() operation. The job of this is to report the some details about the book, including its current state: return "Book[" + this.title + " by " + this.authorsurname + " (" + this.yearpublished + ") " + (this.isborrowed? "borrowed" : "available") + "]"; 2

3 16. We also need to add some code to the update() operations in the view objects, so they can do something when they receive an update notification. To both LibrarianView.update() and BorrowerWishlistView.update(), add the following (using Borrower or Librarian as appropriate): System.out.println("Borrower:" + obs.tostring()); 17. The last code to add is that which will make some Book objects, make LibrarianView and BorrowerWishlistView objects, and manipulate them. This code will sit inside a special method called main(), which we ll put in a separate Application class. a. Right click on the class diagram, then New, Class Diagram Elements, Class By Template b. Under Templates, choose Main Class, then click finish. c. Change the name of the new class to Application. d. Double click on the operation +main:void. Delete the line Application _main = new Application(); and add the following code between the curly brackets: Book b1 = new Book("Hartley", "Fly Fishing", 1991); System.out.println(b1); LibrarianView librarian = new LibrarianView(); BorrowerWishlistView borrower = new BorrowerWishlistView(); b1.addobserver(librarian); b1.addobserver(borrower); b1.checkout(); b1.checkin(); Running the Library Application 18. Finally we create a run configuration. This tells Together where our main class is and how to run it. a. Click on the small down arrow to the right of the green arrow button in the toolbar, and choose Run Configurations. b. Double click Java Application on the left c. For name, enter Library d. For project, click Browse and then double click Practical3. e. For main class, click Search and then double click Application. f. Click Apply, then Run. 19. You should see some text like the following appear in the console window at the bottom of the screen: 3

4 Book[Fly Fishing by Hartley (1991) available] Borrower:Book[Fly Fishing by Hartley (1991) borrowed] Librarian:Book[Fly Fishing by Hartley (1991) borrowed] Borrower:Book[Fly Fishing by Hartley (1991) available] Librarian:Book[Fly Fishing by Hartley (1991) available] 20. When the Book is created, its details are displayed (line 1). Then when it is checked out, the observers are notified, and each one displays the state of the book (lines 2 and 3). Finally, when it is checked in again, the observers are notified again, and each displays the updated state of the book (lines 4 and 5). 21. Try putting // at the start of the addobserver() lines in main(). This comments out the lines so they won t run. Rerun the library application by clicking on the green button with the white arrow in the toolbar. What happens? 22. Try duplicating one of the addobserver() lines in main(), so the same observer is added twice. Rerun the library application. What happens now? 23. Try adding a call to b1.deleteobserver(librarian) between the checkout() and checkin() lines. What happens now? We have now seen in practice how easy it is to add and remove observers from an Observable object (the Subject in design pattern terms). All the observers are notified when some change happens and can take an appropriate course of action (such as displaying the new information). The observer is only notified once, even if it was added to the observed object more than once. If you have time The library isn t going to be popular if it only has one book to borrow! Let s add a few more books, and store them in a sorted set so that we can view them in a logical manner. We ll use the strategy pattern to implement different sorting behaviours. 1. Add a new class YearComparator, which implements the interface java.util.comparator. 2. Add an operation to YearComparator, called compare(), which returns an int, and has parameters of type Object called o1 and o2. Double click on the compare() operation and set its body (between the {} brackets) to the following: return ((Book)o1).yearPublished - ((Book)o2).yearPublished; 3. YearComparator is our first sorting behaviour (or strategy): it specifies that if book 1 was published before book 2, then book 1 is less than book 2. So sorting the books according to this rule will sort them by year of publication. Let s create some books in our main() method, and store them in a TreeSet, which automatically sorts them according to the strategy specified by an object implementing Comparator. Finally, we ll loop over all the books in the catalogue, displaying them in the order that they are stored. (the <Book> syntax is needed: this is Java s way of telling what class of object is stored in the TreeSet) 4

5 java.util.comparator cmp = new YearComparator(); java.util.sortedset<book> catalogue = new java.util.treeset<book>(cmp); catalogue.add(new Book ("Hartley", "Fly Fishing", 1991)); catalogue.add(new Book ("Wells", "The Time Machine", 1895)); catalogue.add(new Book ("Shatner", "TekWar", 1989)); catalogue.add(new Book ("Lineker", "Ghost Stories", 1995)); catalogue.add(new Book ("Keegan", "Football: It's a Funny Old Game", 1988)); System.out.println("Library catalogue:"); for (Book b : catalogue) { System.out.println(b); } 4. Try running the application now. The output should be the following, with all the books sorted by year of publication: Library catalogue: Book[The Time Machine by Wells (1895) available] Book[Football: It's a Funny Old Game by Keegan (1988) available] Book[TekWar by Shatner (1989) available] Book[Fly Fishing by Hartley (1991) available] Book[Ghost Stories by Lineker (1995) available] 5. Try creating a class ReverseYearComparator, where the o1 and o2 are the other way round, and passing that to the TreeSet in main(). What do you expect will happen this time? 6. Java has a built-in comparison method for Strings which we could use to make a Comparator that will sort on book titles or author names. Create a new class TitleComparator, which uses the following in its body: return ((Book)o1).title.compareTo(((Book)o2).title) Pass this into the TreeSet in main(). What do you expect will happen this time? Now that we ve created these comparator classes, we can reuse them for sorting books into the appropriate order in any part of the application. Just swap in the particular comparator that s needed in any given location to get the right sorting behaviour. This is the major benefit of the strategy pattern: wrapping up behaviours so they can be easily replaced or reused. 5

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

CPS122 Lecture: Design Patterns Last revised March 7, 2017

CPS122 Lecture: Design Patterns Last revised March 7, 2017 CPS122 Lecture: Design Patterns Last revised March 7, 2017 Objectives 1. To introduce and illustrate the idea of design patterns 2. To introduce some key design patterns students have used or will use:

More information

CPS122 Lecture: Design Patterns Last revised March 20, 2012

CPS122 Lecture: Design Patterns Last revised March 20, 2012 CPS122 Lecture: Design Patterns Last revised March 20, 2012 Objectives 1. To introduce and illustrate the idea of design patterns 2. To introduce some key design patterns students have used or will use:

More information

RPL's Library Catalogue User Guide

RPL's Library Catalogue User Guide RPL's Library Catalogue User Guide Checklist START In the Fall of 2014, Richmond Public Library (RPL) switched to a brand new Library Catalogue search system. This guide will explain how RPL members can

More information

CS2110: Software Development Methods. Maps and Sets in Java

CS2110: Software Development Methods. Maps and Sets in Java CS2110: Software Development Methods Maps and Sets in Java These slides are to help with the lab, Finding Your Way with Maps This lab uses Maps, and Sets too (but just a little). Readings from textbook:

More information

1 Getting started with Processing

1 Getting started with Processing cis3.5, spring 2009, lab II.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

Borrowing Audiobooks: Computer or MP3 Player

Borrowing Audiobooks: Computer or MP3 Player Page 1 of 11 Borrowing Audiobooks: Computer or MP3 Player Overview: Learn how to install the software required for downloading Audiobooks to your Windows computer or MP3 device. Then find and borrow items

More information

What we have seen so far CSC 142. Object based programming in Java [Reading: chapter 4] Another example. java.awt. Initializing instance fields

What we have seen so far CSC 142. Object based programming in Java [Reading: chapter 4] Another example. java.awt. Initializing instance fields CSC 142 Object based programming in Java [Reading: chapter 4] CSC 142 C 1 What we have seen so far A class is made of instance fields: attributes of the class objects instance methods: behavior of the

More information

CSE 2123: Collections: Priority Queues. Jeremy Morris

CSE 2123: Collections: Priority Queues. Jeremy Morris CSE 2123: Collections: Priority Queues Jeremy Morris 1 Collections Priority Queue Recall: A queue is a specific type of collection Keeps elements in a particular order We ve seen two examples FIFO queues

More information

6.092 Introduction to Software Engineering in Java January (IAP) 2009

6.092 Introduction to Software Engineering in Java January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.092 Introduction to Software Engineering in Java January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

Creating Java Programs with Greenfoot

Creating Java Programs with Greenfoot Creating Java Programs with Greenfoot Working with Source Code and Documentation 1 Copyright 2012, Oracle and/or its affiliates. All rights Objectives This lesson covers the following topics: Demonstrate

More information

Downloading ebooks and audiobooks for the Kindle Fire

Downloading ebooks and audiobooks for the Kindle Fire Reused with permission from the Peabody Institute Library, Peabody, MA. Downloading ebooks and audiobooks for the Kindle Fire You ll Need: your library card, smart phone or tablet computer, and the Overdrive

More information

Loops. In Example 1, we have a Person class, that counts the number of Person objects constructed.

Loops. In Example 1, we have a Person class, that counts the number of Person objects constructed. Loops Introduction In this article from my free Java 8 course, I will discuss the use of loops in Java. Loops allow the program to execute repetitive tasks or iterate over vast amounts of data quickly.

More information

Lecture 14: Design Patterns

Lecture 14: Design Patterns 2. Structural Patterns 2.2. Decorator Pattern Lecture 14: Design Patterns In object-oriented programming, the decorator pattern is a design pattern that allows behaviour to be added to an existing object

More information

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface CHAPTER 1 Finding Your Way in the Inventor Interface COPYRIGHTED MATERIAL Understanding Inventor s interface behavior Opening existing files Creating new files Modifying the look and feel of Inventor Managing

More information

Get Started in 10 Simple Steps

Get Started in 10 Simple Steps Get Started in 10 Simple Steps Leddy Library is transforming the current course reserves system with Course Resource Lists powered by Leganto, a web-based course resource tool that connects library materials

More information

BB4W. KS3 Programming Workbook INTRODUCTION TO. BBC BASIC for Windows. Name: Class:

BB4W. KS3 Programming Workbook INTRODUCTION TO. BBC BASIC for Windows. Name: Class: KS3 Programming Workbook INTRODUCTION TO BB4W BBC BASIC for Windows Name: Class: Resource created by Lin White www.coinlea.co.uk This resource may be photocopied for educational purposes Introducing BBC

More information

Software Systems Development Unit AS1: Introduction to Object Oriented Development

Software Systems Development Unit AS1: Introduction to Object Oriented Development New Specification Centre Number 71 Candidate Number ADVANCED SUBSIDIARY (AS) General Certificate of Education 2014 Software Systems Development Unit AS1: Introduction to Object Oriented Development [A1S11]

More information

Defining Your Own Classes

Defining Your Own Classes Defining Your Own Classes In C, you are allowed to define a struct and then define variables of that struct. But Java allows you to define your own class. This means not only defining the data structure,

More information

Procedural Abstraction

Procedural Abstraction Procedural Abstraction Comp-303 : Programming Techniques Lecture 5 Alexandre Denault Computer Science McGill University Winter 2004 February 16, 2004 Lecture 5 Comp 303 : Programming Techniques Page 1

More information

SYSC Come to the PASS workshop with your mock exam complete. During the workshop you can work with other students to review your work.

SYSC Come to the PASS workshop with your mock exam complete. During the workshop you can work with other students to review your work. It is most beneficial to you to write this mock midterm UNDER EXAM CONDITIONS. This means: Complete the Exam in 3 hour(s). Work on your own. Keep your notes and textbook closed. Attempt every question.

More information

Design Patterns: Part 2

Design Patterns: Part 2 Design Patterns: Part 2 ENGI 5895: Software Design Andrew Vardy with code samples from Dr. Rodrigue Byrne and [Martin(2003)] Faculty of Engineering & Applied Science Memorial University of Newfoundland

More information

Solution register itself

Solution register itself Observer Pattern Context: One object (the Subject) is the source of events. Other objects (Observers) want to know when an event occurs. Or: several objects should be immediately updated when the state

More information

CMPSCI 187: Programming With Data Structures. Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012

CMPSCI 187: Programming With Data Structures. Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012 CMPSCI 187: Programming With Data Structures Lecture 6: The StringLog ADT David Mix Barrington 17 September 2012 The StringLog ADT Data Abstraction Three Views of Data Java Interfaces Defining the StringLog

More information

Outlook Web Access. In the next step, enter your address and password to gain access to your Outlook Web Access account.

Outlook Web Access. In the next step, enter your  address and password to gain access to your Outlook Web Access account. Outlook Web Access To access your mail, open Internet Explorer and type in the address http://www.scs.sk.ca/exchange as seen below. (Other browsers will work but there is some loss of functionality) In

More information

Lecture (01) Getting started. Dr. Ahmed ElShafee

Lecture (01) Getting started. Dr. Ahmed ElShafee Lecture (01) Getting started Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, fundamentals of Programming I, Agenda Download and Installation Java How things work NetBeans Comments Structure of the program Writing

More information

CMSC 331 Second Midterm Exam

CMSC 331 Second Midterm Exam 1 10/ 2 10/ 3 60/ 331 First Midterm Exam 16 November 2004 4 10/ 5 20/ CMSC 331 Second Midterm Exam 6 30/ 7 10/ Name: Username: 150/ You will have seventy-five (75) minutes to complete this closed book

More information

How to: Create a Site in a SharePoint Site Collection. Updated: 12 July 2012

How to: Create a Site in a SharePoint Site Collection. Updated: 12 July 2012 How to: Create a Site in a SharePoint Site Collection Updated: 12 July 2012 Table of Contents Creating sites in the HPIT/Sites sit e collect ion... 3 Create the site... 3 Initial setup... 4 Banner Setup...

More information

7. C++ Class and Object

7. C++ Class and Object 7. C++ Class and Object 7.1 Class: The classes are the most important feature of C++ that leads to Object Oriented programming. Class is a user defined data type, which holds its own data members and member

More information

Ticket Machine Project(s)

Ticket Machine Project(s) Ticket Machine Project(s) Understanding the basic contents of classes Produced by: Dr. Siobhán Drohan (based on Chapter 2, Objects First with Java - A Practical Introduction using BlueJ, David J. Barnes,

More information

CPS122 Lecture: Design Patterns Last revised April 22, 2010

CPS122 Lecture: Design Patterns Last revised April 22, 2010 CPS122 Lecture: Design Patterns Last revised April 22, 2010 Objectives 1. To introduce and illustrate the idea of design patterns 2. To introduce some key design patterns students have used or will use:

More information

Topic 5 Polymorphism. " Inheritance is new code that reuses old code. Polymorphism is old code that reuses new code.

Topic 5 Polymorphism.  Inheritance is new code that reuses old code. Polymorphism is old code that reuses new code. Topic 5 Polymorphism " Inheritance is new code that reuses old code. Polymorphism is old code that reuses new code. 1 Polymorphism Another feature of OOP literally having many forms object variables in

More information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information

Basic Keywords Practice Session

Basic Keywords Practice Session Basic Keywords Practice Session Introduction In this article from my free Java 8 course, we will apply what we learned in my Java 8 Course Introduction to our first real Java program. If you haven t yet,

More information

IAT 445 Lab 10. Special Topics in Unity. Lanz Singbeil

IAT 445 Lab 10. Special Topics in Unity. Lanz Singbeil IAT 445 Lab 10 Special Topics in Unity Special Topics in Unity We ll be briefly going over the following concepts. They are covered in more detail in your Watkins textbook: Setting up Fog Effects and a

More information

CSC9T4: Object Modelling, principles of OO design and implementation

CSC9T4: Object Modelling, principles of OO design and implementation CSC9T4: Object Modelling, principles of OO design and implementation CSCU9T4 Spring 2016 1 Class diagram vs executing program The class diagram shows us a static view of the responsibilities and relationships

More information

Your First Windows Form

Your First Windows Form Your First Windows Form From now on, we re going to be creating Windows Forms Applications, rather than Console Applications. Windows Forms Applications make use of something called a Form. The Form is

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L Inheritance Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 9.1 9.4 1 Inheritance Inheritance allows a software developer to derive

More information

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan that is shown below. Logo Page Heading

More information

Advanced Java Concepts Unit 2: Linked Lists.

Advanced Java Concepts Unit 2: Linked Lists. Advanced Java Concepts Unit 2: Linked Lists. The List interface defines the structure of a linear collection. Here are some of its methods. boolean add( E element ) Appends the element to the end of the

More information

Introduction to Conditionals

Introduction to Conditionals Introduction to Conditionals Conditional Statements Conditional statements are a key to programming and give us control over basic direction following and reasoning that the computer does. Conditional

More information

infogr.am -- getting started

infogr.am -- getting started Infogr.am Basics What is infogr.am? It s a great resource for when you need to visualize data - make simple infographics or make individual charts (bar graphs, pie charts, tables, pictoral charts, etc.).

More information

Question Sheet There are a number of criticisms to UML. List a number of these criticisms.

Question Sheet There are a number of criticisms to UML. List a number of these criticisms. Question Sheet 1 Name: ID: These questions do not have a formal, definitive answer. They are meant to be food for thoughts. Feel free to seek answers on browsing the Internet, talking to other software

More information

A Document Created By Lisa Diner Table of Contents Western Quebec School Board October, 2007

A Document Created By Lisa Diner Table of Contents Western Quebec School Board October, 2007 Table of Contents A Document Created By Lisa Diner Western Quebec School Board October, 2007 Table of Contents Some Basics... 3 Login Instructions... 4 To change your password... 6 Options As You Login...

More information

The home of Junior Librarian.net Classic features the book interface. The book interface hosts a number of interactive links that you can click on.

The home of Junior Librarian.net Classic features the book interface. The book interface hosts a number of interactive links that you can click on. Click on Other Libraries to visit MLSLibraries.net and library catalogues outside of your school. Quick Start Guide Click on Circulate to issue and return books to one student at a time. The home of Junior

More information

Borrowing ebooks & Audiobooks: ipad / iphone (requires ios 6 or higher)

Borrowing ebooks & Audiobooks: ipad / iphone (requires ios 6 or higher) Page 1 of 10 Borrowing ebooks & Audiobooks: ipad / iphone (requires ios 6 or higher) Overview: Learn how to download the OverDrive app, then locate and borrow ebooks from the Library for your ipad or iphone.

More information

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 1 Problem Ralph owns the Trinidad Fruit Stand that sells its fruit on the street, and he wants to use a computer

More information

Object Class. EX: LightSwitch Class. Basic Class Concepts: Parts. CS257 Computer Science II Kevin Sahr, PhD. Lecture 5: Writing Object Classes

Object Class. EX: LightSwitch Class. Basic Class Concepts: Parts. CS257 Computer Science II Kevin Sahr, PhD. Lecture 5: Writing Object Classes 1 CS257 Computer Science II Kevin Sahr, PhD Lecture 5: Writing Object Classes Object Class 2 objects are the basic building blocks of programs in Object Oriented Programming (OOP) languages objects consist

More information

MEAP Edition Manning Early Access Program Get Programming with Java Version 1

MEAP Edition Manning Early Access Program Get Programming with Java Version 1 MEAP Edition Manning Early Access Program Get Programming with Java Version 1 Copyright 2018 Manning Publications For more information on this and other Manning titles go to www.manning.com welcome First,

More information

Excel Intermediate

Excel Intermediate Excel 2013 - Intermediate (103-124) Multiple Worksheets Quick Links Manipulating Sheets Pages EX16 EX17 Copying Worksheets Page EX337 Grouping Worksheets Pages EX330 EX332 Multi-Sheet Cell References Page

More information

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle Boggle If you are not familiar with the game Boggle, the game is played with 16 dice that have letters on all faces. The dice are randomly deposited into a four-by-four grid so that the players see the

More information

Getting Started. 1 by Conner Irwin

Getting Started. 1 by Conner Irwin If you are a fan of the.net family of languages C#, Visual Basic, and so forth and you own a copy of AGK, then you ve got a new toy to play with. The AGK Wrapper for.net is an open source project that

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 11 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2017 Recap I Software Development Processes (cont.) I Project Planning I Design

More information

Introduction to Design Patterns

Introduction to Design Patterns Introduction to Design Patterns First, what s a design pattern? a general reusable solution to a commonly occurring problem within a given context in software design It s not a finished design that can

More information

KWIC Implemented with Event Based Architectural Style

KWIC Implemented with Event Based Architectural Style KWIC Implemented with Event Based Architectural Style KWIC Implemented with Event Based Architectural Style... 2 1 Event Based Systems in General... 2 1.1 Strategy of Events Handling... 2 2 Architecture...

More information

How To Get Your Word Document. Ready For Your Editor

How To Get Your Word Document. Ready For Your Editor How To Get Your Word Document Ready For Your Editor When your document is ready to send to your editor you ll want to have it set out to look as professional as possible. This isn t just to make it look

More information

Exercise: Contact Us Form

Exercise: Contact Us Form TM Exercise: Contact Us Form Exercise Build a Contact Us Form The following are instructions to build a Contact Us form yourself; if you d like a pre-built Contact Us form and campaign, you can download

More information

MESA Student Database How-To Guide for Teachers and Advisors

MESA Student Database How-To Guide for Teachers and Advisors MESA Student Database How-To Guide for Teachers and Advisors Table of Contents Getting Started Gaining access to the new MESA Database.. 2 Logging in to the new MESA Database....3 Navigating the new MESA

More information

CSE 331 Final Exam 12/9/13

CSE 331 Final Exam 12/9/13 Name There are 10 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed book, closed notes, closed

More information

Global Gomoku Lab 4 in D0010E

Global Gomoku Lab 4 in D0010E Luleå University of Technology February 20, 2012 Computer Science Håkan Jonsson Global Gomoku Lab 4 in D0010E 1 Introduction Modern forms of communication are more and more carried out over the Internet,

More information

Borrowing eaudiobooks with an ipod

Borrowing eaudiobooks with an ipod Borrowing eaudiobooks with an ipod OverDrive for Windows Desktop and itunes 2 Download OverDrive for Windows Desktop 2 Download itunes 3 Manually Manage Music in itunes 4 Get eaudiobooks 5 Sign In To Your

More information

Using Dreamweaver CS6

Using Dreamweaver CS6 6 So far we have used CSS to arrange the elements on our web page. We have also used CSS for some limited formatting. In this section we will take full advantage of using CSS to format our web site. Just

More information

CS211 Lecture: Design Patterns Last revised November 30, 2007

CS211 Lecture: Design Patterns Last revised November 30, 2007 CS211 Lecture: Design Patterns Last revised November 30, 2007 Objectives 1. To introduce and illustrate the idea of design patterns 2. To introduce some key design patterns students have used or will use:

More information

Click on OneDrive on the menu bar at the top to display your Documents home page.

Click on OneDrive on the menu bar at the top to display your Documents home page. Getting started with OneDrive Information Services Getting started with OneDrive What is OneDrive @ University of Edinburgh? OneDrive @ University of Edinburgh is a cloud storage area you can use to share

More information

Boolean Expressions (Conditions)

Boolean Expressions (Conditions) Boolean Expressions (Conditions) Boolean Expressions: Boolean expressions evaluate to either True or False. Boolean expressions are constructed using relational operators, which allow for comparison between

More information

Array Based Lists. Collections

Array Based Lists. Collections Array Based Lists Reading: RS Chapter 15 1 Collections Data structures stores elements in a manner that makes it easy for a client to work with the elements Specific collections are specialized for particular

More information

CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class

CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class One of the keys to writing good code is testing your code. This assignment is going to introduce you and get you setup to

More information

Lambdas in Java 8. Start programming in a more functional style

Lambdas in Java 8. Start programming in a more functional style Lambdas in Java 8 Start programming in a more functional style Background Who am I? Tobias Coetzee I m a Technical Lead at BBD I present the Java Expert Level Certifications at BBD (EJB, JPA, etc.) I m

More information

CSE 331 Software Design and Implementation. Lecture 17 Events, Listeners, Callbacks

CSE 331 Software Design and Implementation. Lecture 17 Events, Listeners, Callbacks CSE 331 Software Design and Implementation Lecture 17 Events, Listeners, Callbacks Zach Tatlock / Winter 2016 The limits of scaling What prevents us from building huge, intricate structures that work perfectly

More information

More on Classes. The job of this method is to return a String representation of the object. Here is the tostring method from the Time class:

More on Classes. The job of this method is to return a String representation of the object. Here is the tostring method from the Time class: More on Classes tostring One special method in Java is the tostring method. The method (regardless of which class it s added to) has the following prototype: public String tostring(); The job of this method

More information

Access Intermediate

Access Intermediate Access 2013 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC124 AC125 Selecting Fields Pages AC125 AC128 AC129 AC131 AC238 Sorting Results Pages AC131 AC136 Specifying Criteria Pages

More information

C# Language. CSE 409 Advanced Internet Technology

C# Language. CSE 409 Advanced Internet Technology C# Language Today You will learn Building a basic class Value Types and Reference Types Understanding Namespaces and Assemblies Advanced Class Programming CSE 409 Advanced Internet Technology Building

More information

You should now start on Chapter 4. Chapter 4 introduces the following concepts

You should now start on Chapter 4. Chapter 4 introduces the following concepts Summary By this stage, you have met the following principles : the relationship between classes and objects that a class represents our understanding of something weʼre interested in, in a special and

More information

CS 520 Theory and Practice of Software Engineering Fall 2017

CS 520 Theory and Practice of Software Engineering Fall 2017 CS 520 Theory and Practice of Software Engineering Fall 2017 OO design patterns September 28, 2017 Logistics Homework 1 deadline: 10/17/2017. Paper reading 1 (Practical guide to statistical tests) deadline:

More information

Welcome to Introduction to Microsoft Excel 2010

Welcome to Introduction to Microsoft Excel 2010 Welcome to Introduction to Microsoft Excel 2010 2 Introduction to Excel 2010 What is Microsoft Office Excel 2010? Microsoft Office Excel is a powerful and easy-to-use spreadsheet application. If you are

More information

GradeConnect.com. User Manual

GradeConnect.com. User Manual GradeConnect.com User Manual Version 2.0 2003-2006, GradeConnect, Inc. Written by Bernie Salvaggio Edited by Charles Gallagher & Beth Giuliano Contents Teachers...5 Account Basics... 5 Register Your School

More information

Initial Coding Guidelines

Initial Coding Guidelines Initial Coding Guidelines ITK 168 (Lim) This handout specifies coding guidelines for programs in ITK 168. You are expected to follow these guidelines precisely for all lecture programs, and for lab programs.

More information

CCH INCORPORATED 05/03

CCH INCORPORATED 05/03 Button Bar Main Menu Return to the main tab level of the current library without deselecting your targets Preferences Set preferences for searching, document display, and other functions Citation Search

More information

Creating Specific Views and Match Lines

Creating Specific Views and Match Lines Creating Specific Views and Match Lines As you can see, the Autodesk Revit Architecture platform is all about the views. In fact, by using Revit, not only are you replacing the application you use for

More information

Pull Lecture Materials and Open PollEv. Poll Everywhere: pollev.com/comp110. Lecture 12. else-if and while loops. Once in a while

Pull Lecture Materials and Open PollEv. Poll Everywhere: pollev.com/comp110. Lecture 12. else-if and while loops. Once in a while Pull Lecture Materials and Open PollEv Poll Everywhere: pollev.com/comp110 Lecture 12 else-if and while loops Once in a while Fall 2016 if-then-else Statements General form of an if-then-else statement:

More information

Classroom Blogging. Training wiki:

Classroom Blogging. Training wiki: Classroom Blogging Training wiki: http://technologyintegrationshthornt.pbworks.com/create-a-blog 1. Create a Google Account Navigate to http://www.google.com and sign up for a Google account. o Use your

More information

DarkRift Server Plugin Tutorial

DarkRift Server Plugin Tutorial DarkRift Server Plugin Tutorial Introduction This tutorial will guide you through the process of writing server plugins. It will introduce you to the server s inner architecture and will give you a good

More information

Carleton University COMP1406/1006, Summer 2013 Tutorial 2

Carleton University COMP1406/1006, Summer 2013 Tutorial 2 Carleton University COMP1406/1006, Summer 2013 Tutorial 2 Tuesday July 16 and Thursday July 18 When you have completed this tutorial, you should 1. Be comfortable with basic inheritance and overriding

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 10 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2016 Last Time Project Planning Non-agile Agile Refactoring Contents Basic Principles

More information

Event-driven Programming, Separation of Concerns, the Observer pattern and the JavaFX Event Infrastructure

Event-driven Programming, Separation of Concerns, the Observer pattern and the JavaFX Event Infrastructure Java GUIs in JavaFX Event-driven Programming, Separation of Concerns, the Observer pattern and the JavaFX Event Infrastructure 1 GUIs process inputs and deliver outputs for a computing system Inputs Click

More information

Java Collections Framework

Java Collections Framework Java Collections Framework Introduction In this article from my free Java 8 course, you will be given a high-level introduction of the Java Collections Framework (JCF). The term Collection has several

More information

Slicing. Open pizza_slicer.py

Slicing. Open pizza_slicer.py Slicing and Tuples Slicing Open pizza_slicer.py Indexing a string is a great way of getting to a single value in a string However, what if you want to use a section of a string Like the middle name of

More information

The first program: Little Crab

The first program: Little Crab Chapter 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if-statement In the previous chapter,

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #23: OO Design, cont d. Janak J Parekh janak@cs.columbia.edu Administrivia HW#5 due Tuesday And if you re cheating on (or letting others see your) HW#5

More information

POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE

POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE COURSE NAME: OBJECT ORIENTED PROGRAMMING COURSE CODE: OOP521S NQF LEVEL: 6 DATE: NOVEMBER 2015 DURATION: 2 HOURS

More information

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal COMSC-051 Java Programming Part 1 Part-Time Instructor: Joenil Mistal Chapter 4 4 Moving Toward Object- Oriented Programming This chapter provides a provides an overview of basic concepts of the object-oriented

More information

SharePoint Designer Advanced

SharePoint Designer Advanced SharePoint Designer Advanced SharePoint Designer Advanced (1:00) Thank you for having me here today. As mentioned, my name is Susan Hernandez, and I work at Applied Knowledge Group (http://www.akgroup.com).

More information

Inheritance. Inheritance allows the following two changes in derived class: 1. add new members; 2. override existing (in base class) methods.

Inheritance. Inheritance allows the following two changes in derived class: 1. add new members; 2. override existing (in base class) methods. Inheritance Inheritance is the act of deriving a new class from an existing one. Inheritance allows us to extend the functionality of the object. The new class automatically contains some or all methods

More information

CSE 331 Software Design and Implementation. Lecture 16 Callbacks and Observers

CSE 331 Software Design and Implementation. Lecture 16 Callbacks and Observers CSE 331 Software Design and Implementation Lecture 16 Callbacks and Observers Leah Perlmutter / Summer 2018 Announcements Announcements Quiz 6 due Thursday 8/2 Homework 7 due Thursday 8/2 Callbacks The

More information

Case studies: Outline Case Study: Noughts and Crosses

Case studies: Outline Case Study: Noughts and Crosses I. Automated Banking System Case studies: Outline Case Study: Noughts and Crosses II. III. Library Noughts and Crosses Definition of the problem Game played on a 3x3 square board between two players. The

More information

Java4340r: Review. R.G. (Dick) Baldwin. 1 Table of Contents. 2 Preface

Java4340r: Review. R.G. (Dick) Baldwin. 1 Table of Contents. 2 Preface OpenStax-CNX module: m48187 1 Java4340r: Review R.G. (Dick) Baldwin This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 4.0 Abstract This module contains review

More information

CS193P: HelloPoly Walkthrough

CS193P: HelloPoly Walkthrough CS193P: HelloPoly Walkthrough Overview The goal of this walkthrough is to give you a fairly step by step path through building a simple Cocoa Touch application. You are encouraged to follow the walkthrough,

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

Reference Counting. Steven R. Bagley

Reference Counting. Steven R. Bagley Reference Counting Steven R. Bagley Previously Objects are blocks of memory Store pointer to base of object s memory so we can reference it Memory needs to be released when the object is no longer needed

More information