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 visionwhat was/is Freecell? what can we add?harmonious sense of purpose•develop a creative environmentthe more ideas the better, ideas are infectiousdon’t flip the BOZO bit•scout the futurewhat’s coming, what’s the next projectwhat new technologies will affect this projectSoftware Design10.2Scheduling/Slipping•McCarthy page 50, Group Psyche, TEAM=SOFTWAREanything you need to know about a team can be discovered by examining the software and vice versaleadership is interpersonal choreographygreatness 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 complexitydon’t hide from problemsbuild from the slip, don’t destroyhit 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 moneywhat 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/entrepreneurswhat 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 gapExample: 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-lineNo restrictions on access, reads files, URLS, …GUI applications typically include a JFrame•Has title, menus, closeable, resizeable•Applet is downloaded via the webRuns in browser, not trusted (but see policy later)Can't read files on local machine (but see policy)Can't be resized within browserUses 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/logicWhat will be in the content pane of both deploymentsMakes GUI very simple, see code examplesUse JPanel in both Applet and Application•Test with application first, easier to read files/resourcesMigrate to Applet, test first with appletviewerMigrate 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 structureClass names correspond to file namesPackage names correspond to directoriesRelated classes belong together, easier to develop, easier to deployLeverage default/package access, use properties of protected which is subclass and package accessSoftware Design10.9Packages, javac, java, javadoc•In moderately big programs packages are essentialCan’t easily live in a directory with 50 .java filesCan’t easily co-exist in such a directoryHarder to use tools like Make and Ant•Each of javac, java, javadoc is slightly different with packages, all must co-exist with CLASSPATHFile system vs. compiler vs. runtimeSource of confusion and problemsIDEs can manage Make/CLASSPATH issuesSoftware Design10.10CLASSPATH and related concepts•The default CLASSPATH is . current directoryWorks fine with default/unnamed packagesWill not work with named packages•Set CLASSPATH to directory in which packages live also include current dirsetenv 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 compileCan cd into directory and type javac *.javaCan also type javac ooga/*.java from one level upIf CLASSPATH isn't set, the second won't work•To runjava 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 documenthttp://java.sun.com/j2se/javadoc/faq.htmlDon't need to use –sourcepath, but canjavadoc –d doc ooga ooga.timer ooga.game …Software Design10.12javadoc for packages•See the javadoc faq http://java.sun.com/j2se/javadoc/faq.htmlFor 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