programming heuristics implications for tagcloud
play

Programming Heuristics Implications for tagcloud? Identify the - PowerPoint PPT Presentation

Programming Heuristics Implications for tagcloud? Identify the aspects of your application that vary What might change in going from release 0.9 to 1.0 and separate them from what stays the same to 2.0 in tag cloud Take what varies


  1. Programming Heuristics Implications for tagcloud?  Identify the aspects of your application that vary  What might change in going from release 0.9 to 1.0 and separate them from what stays the same to 2.0 in tag cloud  Take what varies and encapsulate it  Should we worry about future changes?  Program to an interface, not an implementation  Should we make things work now?  Specify behavior by name, not by working code  Can we do both?  Favor Composition over Inheritance  Strategy pattern  Use "has-a" rather than "is-a"  Algorithm varies independently from clients that  Classes and code should be open for extension, but use it, closed to modification  What are the algorithms in tag cloud?  The Open-Closed Principle Software Design 2.1 Software Design 2.2 Design patterns Towards being a hacker “... describes a problem which occurs over and over again in our  See the hacker-faq (compsci 108 web page) environment, and then describes the core of the solution to that  Hackers solve problems and build things, and they problem, in such a way that you can use this solution a million believe in freedom and voluntary mutual help. To be times over, without ever doing it the same way twice” accepted as a hacker, you have to behave as though you Christopher Alexander, quoted in GOF have this kind of attitude yourself. And to behave as though you have the attitude, you have to really believe  Name the attitude.  good name is a handle for the pattern, builds vocabulary  The world is full of fascinating problems  Problem  no one should have to solve the same problem twice  when applicable, context, criteria to be met, design goals  boredom and drudgery are evil  Solution  freedom is good  design, collaborations, responsibilities, and relationships  attitude is no substitute for competence  Forces and Consequences  trade-offs, problems, results from applying pattern: help in You may not work to get reputation, but the reputation is a real evaluating applicability payment with consequences if you do the job well. Software Design 2.3 Software Design 2.4

  2. Aside: ethics of software Richard Stallman  What is intellectual property, why is it  Free Software movement important?  Free as in speech  what about FSF, GPL, copy-left, open source,  Not Free as in beer  what about money and monopolies  Wrote emacs, gcc,gdb,…  GNU's not Unix  What does it mean to act ethically and responsibly?  Grace Murray Hopper award,  What about copying? stealing? borrowing? Macarthur award, EFF Pioneer  No harm, no foul? Is this a legitimate award, philosophy?  Can software developers make a difference in the world? Software Design 2.5 Software Design 2.6 java.io.* java.util.*  What is a package? How are packages organized in  Contains the collections framework, legacy Java? How do you find how to use them? collection classes, event model, date and time  Reading API, reading books, writing code facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number  In Java there are lots of ways of reading, mostly using InputStream and Reader abstract classes generator, and a bit array)  Corresponding Writer classes?  From programmer's perspective the Collection  These classes use the Decorator pattern hierarchy provides data structures  Reading files? FileReader to BufferedReader  Lists, Sets, Maps of elements (and others)  How to read System.in line-by-line?  Your code must know how to play well with  See also java.util.Scanner , your friend! collections Software Design 2.7 Software Design 2.8

  3. Playing well with Collections Loose coupling and collections  Every object has an equals(..) method, contract?  How do you store data in tag cloud?  What does this return? How do you implement  What do you store? it, what about apples and oranges?  How do you access it?  Default behavior? When to over-ride?  What are performance issues and trade-offs?  If you override/over-ride equals, see hashCode()  Difference in storing into a Map versus storing into  What does this return? Implementation issues? a CloudCollector?  Good, bad, …?  What heuristics are in play?  What do you do first? Software Design 2.9 Software Design 2.10

Recommend


More recommend