1 / 16

CSE115: Introduction to Computer Science I

CSE115: Introduction to Computer Science I. Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu. Announcements. Exam 3 on Wednesday 11/11 covers material from last exam up to and including Friday 11/06 Review on Monday 11/09

sheba
Download Presentation

CSE115: Introduction to Computer Science I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu

  2. Announcements • Exam 3 on Wednesday 11/11 • covers material from last exam up to and including Friday 11/06 • Review on Monday 11/09 • Exercises: FA09-CSE115-Exercises project in LectureCode repository • Review session? Interest level?

  3. Conference Trip • OOPSLA • Object Oriented Programs, Systems, Languages and Applications • Ran workshop • Interesting tutorials • Real-time Java • deadlines, real-time threads, garbage collection strategies • runs in standard Java Virtual Machine • Erlang OTP/Design Patterns • distributed and concurrent programs • runs in its own Virtual Machine

  4. Interesting people Take-home message: • be a student volunteer if possible • attend a conference before graduating • attend conferences regularly after graduating (continuing education)

  5. State systems • State-based system: • system’s behavior based on its current state • Many systems are state-based: • Cable/Satellite TV box • Wrist-watch • Cell phone interface

  6. State Diagram push button OFF ON push button

  7. State Pattern example

  8. Polymorphism • Behavior determined by method of object, because… • it’s the object that responds: • the type of the object determines response • the type of the reference to object doesn’t

  9. Polymorphism declared type of variable a supertype of actual type of object

  10. Proxy Pattern Polymorphism

  11. Polymorphism(in proxy pattern) context delegates method call to concrete tool

  12. State Pattern delegation

  13. Delegation in State code public class DeskLamp { private IState _state; public DeskLamp() { _state = new Off(); } public void pushButton() { _state.pushButton(this); } public void setState(IState s) { _state = s; } }

  14. Proxy Pattern delegation

  15. Delegation in Proxy code public class Proxy implements ISomething { private ISomthing _target; public Proxy(ISomething t) { _target = t; } public void methodA(X x, Y y, Z z) { _target.methodA(x, y, z); } public void methodB(R r, S s) { _target.methodB(r, s); } // and so on }

More Related