160 likes | 414 Views
3 Kinds of Libraries. And some reflections on libraries in general. As you arrive… please sit with your Tivoo groups. In Class Today. Libraries for parsing XML Libraries for dealing with Dates Libraries for outputting HTML Reflections. Libraries for XML. DOM - Document Object Model
E N D
3 Kinds of Libraries And some reflections on libraries in general As you arrive…please sit with your Tivoo groups
In Class Today • Libraries for parsing XML • Libraries for dealing with Dates • Libraries for outputting HTML • Reflections
Libraries for XML • DOM - Document Object Model • SAX - Simple API for XML • JDOM - “a Java-based document object model for XML files” XPath – an added bonus
In Class Today • Libraries for parsing XML • Libraries for dealing with Dates • Libraries for outputting HTML • Reflections
Unix Epoch Time and “Human” Views of Time http://coolepochcountdown.com/ Sunday, November 4, 2012, 1:59am. What’s wrong with converting the above date to epoch time?
Joda’sParsing Or for more fancy formatting…
In Class Today • Libraries for parsing XML • Libraries for dealing with Dates • Libraries for outputing HTML • Reflections
In Class Today • Libraries for parsing XML • Libraries for dealing with Dates • Libraries for outputting HTML • Reflections
Reflections on Libraries • It’s usually not a good idea to hand-parse a standard format (unless you’re really looking for quick-n-dirty) • In Java, there’s almost always a “built in” way to do what you want • Using libraries has a cost, so you almost never want to use them if the code you’d be replacing is small • But do make your coding a pleasure