DOC PREVIEW
Duke CPS 108 - Lecture

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Working as part of a groupScheduling/SlippingAside: ethics of softwareSoftware DesignComfort: technology and mathematicsApplets and ApplicationsDeveloping Applets and ApplicationsPackages, JAR files, deploymentPackages, javac, java, javadocCLASSPATH and related conceptsMore package detailsjavadoc for packagesFrom JITs to DeoptimizationLoading .class filesThe ClassLoaderRunning an AppletSoftware Design10.1Working as part of a group see McCarthy, Dynamics of Software Development•establish a shared visionwhat was/is Freecell? what can we add?harmonious sense of purpose•develop a creative environmentthe more ideas the better, ideas are infectiousdon’t flip the BOZO bit•scout the futurewhat’s coming, what’s the next projectwhat new technologies will affect this projectSoftware Design10.2Scheduling/Slipping•McCarthy page 50, Group Psyche, TEAM=SOFTWAREanything you need to know about a team can be discovered by examining the software and vice versaleadership is interpersonal choreographygreatness results from ministrations to group psyche which is an “abstract average of individual psyches”mediocrity results from neglect of group psyche•Slipping a schedule has no moral dimension (pp 124-145)no failure, no blame, inevitable consequence of complexitydon’t hide from problemsbuild from the slip, don’t destroyhit the next milestone, even if redefined (“vegetate”)Software Design10.3Aside: ethics of software•What is intellectual property, why is it important?what about FSF, GPL, copy-left, open source, …what about moneywhat about monopolies•What does it mean to act ethically and responsibly?What is the Unix philosophy? What about protection? What about copying? What about stealing? What about borrowing?No harm, no foul? Is this a legitimate philosophy?•The future belongs to software developers/entrepreneurswhat can we do to ensure the world’s a good place to be?Software Design10.4Software DesignSee Alan Cooper, The Essentials of User Interface Design •who designs the software?•Implementation is view of software developer, user’s view is mental model, software designer has to bridge this gapExample: copy/move files in a Windows/Mac environment, what’s the difference in dragging a file/folder between two folders on the same device and dragging between devices, e.g., c: to a:? Is this a problem? To whom?•Implications in Freecell? What’s a Pile? A Deck?Implementation modeluser’s modelworsebetterSoftware Design10.5Comfort: technology and mathematics•“Show me all the first year students who live in Pegram and in Brown”what does “and” mean here? Does the average user understand Boolean? Does the average programmer understand Boolean? Recursion? Threads? Queues?•How you solve a problem in your program isn’t (necessarily) how the user solves the problem, keep these distinctions clear•“Saying that someone is ‘computer literate’ is really a euphemism meaning he has been indoctrinated and trained in the irrational and counter-intuitive way that file systems work, and once you have been properly subverted into thinking like a computer nerd, the obvious ridiculousness of the way the file system presents itself to the user doesn’t seem so foolish.”Software Design10.6Applets and Applications•Application run by user, double-clickable/command-lineNo restrictions on access, reads files, URLS, …GUI applications typically include a JFrame•Has title, menus, closeable, resizeable•Applet is downloaded via the webRuns in browser, not trusted (but see policy later)Can't read files on local machine (but see policy)Can't be resized within browserUses jar file to get all classes at once•Alternative? Establish several connections to serverSoftware Design10.7Developing Applets and Applications•Create a JPanel with the guts of the GUI/logicWhat will be in the content pane of both deploymentsMakes GUI very simple, see code examplesUse JPanel in both Applet and Application•Test with application first, easier to read files/resourcesMigrate to Applet, test first with appletviewerMigrate to web, may need to clear cache/reloadSoftware Design10.8Packages, JAR files, deploymenthttp://java.sun.com/docs/books/tutorial/jar/basics/index.html•Java packages correspond semantically to modules (related classes) and syntactically to a directory structureClass names correspond to file namesPackage names correspond to directoriesRelated classes belong together, easier to develop, easier to deployLeverage default/package access, use properties of protected which is subclass and package accessSoftware Design10.9Packages, javac, java, javadoc•In moderately big programs packages are essentialCan’t easily live in a directory with 50 .java filesCan’t easily co-exist in such a directoryHarder to use tools like Make and Ant•Each of javac, java, javadoc is slightly different with packages, all must co-exist with CLASSPATHFile system vs. compiler vs. runtimeSource of confusion and problemsIDEs can manage Make/CLASSPATH issuesSoftware Design10.10CLASSPATH and related concepts•The default CLASSPATH is . current directoryWorks fine with default/unnamed packagesWill not work with named packages•Set CLASSPATH to directory in which packages live also include current dirsetenv CLASSPATH "~ola:."setenv CLASSPATH "`pwd`:."On windows machines change registry variable, separator is semi-colon rather than colon•All problems are CLASSPATH problemsSoftware Design10.11More package details•To compileCan cd into directory and type javac *.javaCan also type javac ooga/*.java from one level upIf CLASSPATH isn't set, the second won't work•To runjava ooga.TicTac will work, you must specify the "real" name of the class being used.Reading files requires full-paths or run from directory in which file lives•To documenthttp://java.sun.com/j2se/javadoc/faq.htmlDon't need to use –sourcepath, but canjavadoc –d doc ooga ooga.timer ooga.game …Software Design10.12javadoc for packages•See the javadoc faq http://java.sun.com/j2se/javadoc/faq.htmlFor each package create a package.html file•Not in /** */ javadoc format, strictly html•First sentence after <body> is main description; a sentence ends with a period.•The package.html file should provide complete instructions on how to use the


View Full Document

Duke CPS 108 - Lecture

Download Lecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?