Apache Commons - Don\'t re-invent the wheel

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Apache Commons - Don\'t re-invent the wheel - Presentation Transcript

    1. Apache Commons Torsten Curdt don’t re-invent the wheel
    2. Why are you a Developer?
    3. Creating & Building
    4. That is a problem!
    5. The journey is the goal.
    6. Use vs Build
    7. A Story of Re-use
    8. •Faster •Better designed •Less time •Smaller team
    9. Original Re-Impl 0 5,000 10,000 15,000 20,000 25,000 hours
    10. 20,000 hours
    11. 7x
    12. 5x
    13. How did we do it?
    14. Re-use to Excel
    15. Know your libraries!
    16. Heritage
    17. Charter “Creation of small re-useable components that can be used across projects. They are supposed to have as few dependencies as possible, meant to be well tested and compatible with the current de-facto standard version of the JDK”
    18. Growth Sandbox Proper Dormant
    19. Project Stats 60 Dormant Proper 37 Sandbox 45 30 37 15 18 0 Active Inactive
    20. Proper
    21. Collections Map map = new CaseInsensitiveMap(); map.put(\"One\", \"One\"); map.get(\"ONE\"); Map colorMap = MapUtils.toMap(new String[][] {{ {\"red\", \"#FF0000\"}, {\"green\", \"#00FF00\"}, {\"blue\", \"#0000FF\"} });
    22. Primitives ArrayByteList list = new ArrayByteList(); list.add(byte); list.removeElementAt(index); byte[] bytes = list.toArray();
    23. IO InputStream in; OutputStream out; IOUtils.copy(in, out); ... byte[] data = IOUtils.toByteArray(in);
    24. Lang String s = “Apache Jakarta Commons”; StringUtils.right(s, 7); // “Commons” String n = “0”; StringUtils.leftPad(s, 4, ‘0’); // “0000”
    25. Logging public class C { private Log log = LogFactory.getLog(C.class); ... if (log.isDebugEnabled()) { log.debug(\"log message\"); }
    26. CLI Options options = new Options(); options.addOption(\"h\", false, \"display usage\"); CommandLine line = parser.parse(options, args); if(line.hasOption(\"h\")) { HelpFormatter f = new HelpFormatter(); f.printHelp(\"myprogram\", options); ...
    27. Email SimpleEmail email = new SimpleEmail(); email.setHostName(\"mail.myserver.com\"); email.addTo(\"jdoe@somewhere.org\", \"John Doe\"); email.setFrom(\"me@apache.org\", \"Me\"); email.setSubject(\"Test message\"); email.setMsg(\"A simple test of commons-email\"); email.send();
    28. Net NNTPClient client = new NNTPClient(); client.connect(\"news.server.net\"); NewsgroupInfo[] = client.listNewsgroups(); client.disconnect();
    29. JXPath XPathContext context = JXPathContext.newContext(dom); String value = (String) context.getValue(\"/my/xpath/to/value\");
    30. VFS FileSystemManager fs = VFS.getManager(); FileObject jar = fs.resolveFile( \"jar:lib/aJarFile.jar\" ); FileObject[] childs = jar.getChildren(); for (int i=0; i < childs.length; i++ ) { ...
    31. JCI JavaCompiler compiler = new EclipseJavaCompiler(); ResourceStore store = new MemoryResourceStore(); CompilationResult result = compiler.compile( new String[] { \"org/MyClass.java\" }, new FileResourceReader(directory), store );
    32. Exec OutputStream out; OutputStream error; CommandLine cl = new CommandLineImpl(); cl.setExecutable(\"path/to/exe\"); cl.addArgument(\"arg\"); exec.execute(cl, out, error);
    33. Proxy o = (MyObject) new CglibProxyFactory() .createInterceptorProxy( new MyObjectImpl(), new LoggingInterceptor(log), new Class[]{ MyObject.class }); o.test(”test”); [DEBUG] - BEGIN test(test) [DEBUG] - END test()
    34. Overview attributes, beanutils, betwixt, chain, cli, codec, collections, configuration, daemon, dbcp, dbutils, digester, discovery, el, email, fileupload, httpclient, io, jci, jelly, jexl, jxpath, lang, launcher, logging, math, modeler, net, pool, primitives, proxy, scxml, transaction, validator, vfs
    35. Sandbox
    36. CSV String[][] data = CSVParser.parse(string); CSVParser parser = new CSVParser(reader,’;’); String[][] data = parser.getAllValues();
    37. Javaflow class MyRunnable implements Runnable { public void run() { for(int i=0; i<10; i++ ) Continuation.suspend(); }} Continuation c = Continuation.startWith( new MyRunnable()); Continuation d = Continuation.continueWith(c); ...
    38. OpenPGP keyRing = new BouncyCastleKeyRing( secret, public, password); signer = new BouncyCastleOpenPgpSigner(); signer.detachedSign( fileInputStream signatureOutputStream, keyId, keyRing, true );
    39. Overview compress, csv, expression, finder, flatfile, functor, i18n, id, javaflow, jnet, js2j, me, monitoring, nabla, openpgp, performance, pipeline, validator2
    40. Dormant
    41. Overview benchmark, cache, clazz, codec- mulipart, combo, contract, events, feedparser, filters, functor, grant, graph2, http, jex, jjar, jpath, jrcs, jux, latka, mapper, messenger, pattern, periodicity, reflect, resources, rupert, scaffold, services, servlet, simplestore, tbm, test, threading, threadpool, workflow, xmlio, xmlunit, xo
    42. direct dependency no dependency 20% 80%
    43. We need you! dev@commons.apache.org
    44. Thanks! http://vafer.org/blog http://twitter.com/tcurdt

    + tcurdttcurdt, 2 years ago

    custom

    1048 views, 1 favs, 2 embeds more stats

    Introduction to Apache Commons presented at Apache more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1048
      • 1045 on SlideShare
      • 3 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 58
    Most viewed embeds
    • 2 views on http://www.slideshare.net
    • 1 views on http://localhost

    more

    All embeds
    • 2 views on http://www.slideshare.net
    • 1 views on http://localhost

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories