DOC PREVIEW
Duke CPS 108 - Notes

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:

Software Design10.1Working as part of a groupsee McCarthy, Dynamics of Software Developmentz establish a shared vision¾ what was/is Freecell? what can we add?¾ harmonious sense of purposez develop a creative environment¾ the more ideas the better, ideas are infectious¾ don’t flip the BOZO bitz scout the future¾ what’s coming, what’s the next project¾ what new technologies will affect this projectSoftware Design10.2Scheduling/Slippingz 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 psychez 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 softwarez What is intellectual property, why is it important?¾ what about FSF, GPL, copy-left, open source, …¾ what about money¾ what about monopoliesz 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?z 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 Designz who designs the software?z 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?z Implications in Freecell? What’s a Pile? A Deck?Implementation modeluser’s modelworsebetterSoftware Design10.5Comfort: technology and mathematicsz “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?z How you solve a problem in your program isn’t (necessarily) how the user solves the problem, keep these distinctions clearz “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 Applicationsz 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, resizeablez 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 Applicationsz 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 Applicationz 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.htmlz 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, javadocz 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 Antz 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 conceptsz The default CLASSPATH is . current directory¾ Works fine with default/unnamed packages¾ Will not work with named packagesz 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 colonz All problems are CLASSPATH problemsSoftware Design10.11More package detailsz 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 workz 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 livesz 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 packagesz 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 package. All programmer documentation should be accessible or part of this file, e.g., in the file or linked to the file¾ Use the {@link foo.bar bar} tag appropriately.• See the FAQ, or the source for the elan package onlinez You may want to keep .java and .class files separate, see sourcepath and classpath as commandline args to javaSoftware Design10.13From JITs to Deoptimizationz JITs compile bytecodes when


View Full Document

Duke CPS 108 - Notes

Download Notes
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 Notes 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 Notes 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?