1 / 15

Outline

SIMPLE PROBLEM SOLVING in Java: a Problem Set Framework Viera K. Proulx Richard Rasala Jason Jay Rodrigues http://www.ccs.neu.edu/jpt CCSCNE 2002 Conference Worcester State College, Worcester, MA April, 19, 2002. Outline. Motivation Goals JPT background The Problem Set Framework

xenon
Download Presentation

Outline

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. SIMPLE PROBLEM SOLVING in Java:a Problem Set FrameworkViera K. ProulxRichard RasalaJason Jay Rodrigueshttp://www.ccs.neu.edu/jptCCSCNE 2002 Conference Worcester State College, Worcester, MAApril, 19, 2002

  2. Outline • Motivation • Goals • JPT background • The Problem Set Framework • The architecture • Uses of PSF • This is all you need to know Proulx, Rasala, Rodrigues

  3. Motivation We wanted to be able to • write small functions – without classes • explore classes • constructors, member functions • copy vs. assignment vs. clone • test classes as they are built • run several different applications easily Proulx, Rasala, Rodrigues

  4. Goals Create a framework that would give us • access to the console • access to the graphics window • one action button per function we want to test • automatic action button definition and labeling • synchronization of the button responses • ability to add other classes to the project Proulx, Rasala, Rodrigues

  5. JPT Background Toolkit to support fast GUI building in Java Support for Model – View communication Support for Action – Control binding Support for robust input stream parsing Support for graphics Support for layout control Support for event – action – adapters Platform for showcase labs Proulx, Rasala, Rodrigues

  6. JPT Background Actions – installed in one statement Console • parsed error-checked input • color coded input, output, error stream • scrollable, can save to a file, resize font Graphics – buffered panel with mouse action adapter GUI components, layout control, more... Proulx, Rasala, Rodrigues

  7. The Problem Set Framework • Two classes – application and framework • Application builds GUI, buttons, console • Framework contains user’s test functions • Mutual reference – allows two-way access • The test functions access the graphics window and console supplied by the application • The GUI buttons created by the application use the code in the test functions for their actions Proulx, Rasala, Rodrigues

  8. The Problem Set Framework • Each test function runs in its own thread: ThreadedAction class defined • All functions synchronized • Use reflection to • extract function names • create button labels • define corresponding actions • Catch the exception messages – forward to the user Proulx, Rasala, Rodrigues

  9. The Architecture and Design User side: ProblemSetClass • Modify the ProblemSetClass • define the test functions using the pattern public synchronized void TestFunction(){...} • define additional utility functions – if you wish • define objects that all test functions can share – if you wish • use text I/O – via System or (JPT) console • use graphics (Java2D Graphics) – in the BufferedPanel • Add any classes that you want to test to the project • UseGeneralDialog for additional interactions Proulx, Rasala, Rodrigues

  10. The Architecture and Design System side: ProblemSetApplication • define and install the BufferedPanel in the main frame and activate the (JPT) console • use reflection to get a list of all methods that are declared as: public synchronized void TestFunction(); • create a ThreadedAction and button for each • use method names for button labels • add the Clear Window button and the Exit button Proulx, Rasala, Rodrigues

  11. Uses of PSF • Simple algorithmics and problem sets • Tutorials on OO concepts • constructors and the reference model • inheritance • abstract classes • static • interfaces • casting • Data structure exercises – with display Proulx, Rasala, Rodrigues

  12. Uses of PSF • In lecture demonstrations and live exploration of new concepts • Unit testing for a new class or classes • to be used both by students and developers • Demo platform • several different applications may be grouped in one PSF and launched without the need for separate projects or separate compilations Proulx, Rasala, Rodrigues

  13. This Is All You Need To Know • Project includes two classes and jpt.jar • Modify only the file ProblemSetClass.java • Insert functions to run – make sure that the method header has the form public synchronized void TestFunction( ){...} • Add utility functions using a different header • Add additional classes as needed • Compile and run the PSF application Proulx, Rasala, Rodrigues

  14. This Is All You Need To Know We cannot and do not want to live without it • We use the PSF in nearly every lecture • Students run regression tests on their work • Tutorial examples on classes and objects are given to students in PSF format • We use the PSF test bed to develop new JPT features Proulx, Rasala, Rodrigues

  15. SIMPLE PROBLEM SOLVING in Java:a Problem Set FrameworkViera K. Proulx vkp@ccs.neu.eduRichard Rasala rasala@ccs.neu.eduJason Jay Rodrigues jjayr@ccs.neu.eduhttp://www.ccs.neu.edu/jptPartially supported by the NSF grant DUE-9950829

More Related