Skip to content

Random thoughts and TODO for Boon

RichardHightower edited this page Feb 16, 2014 · 7 revisions

If you are new to boon, you might want to start here. Boon is a opinionated, low ceremony Java framework.

Java Boon

Sonic Boom! Java Boon!

What is Boon?

Boon is simple opinionated Java for the novice to expert level Java Programmer. It is a framework to fit the gaps between Python, Ruby, and Perl when you are in Java land.

Whenever possible no overloading (except for language literal simulations). Whenever possible toString shall produce valid JSON.

Universal methods to work with list, appendable, strings, sets, maps, etc. if applicable:

  • len - length (map, list, set, string, char sequence, array)
  • in - checks if value is in (map (checks for key), list, set, string, char sequence, array)
  • idx - indexes object (map, list, set, string, char sequence, array)
  • idx - does set (map, list, set, string, char sequence, array)
  • add - adds item to object (map (adds entry), list, set, string, char sequence, array)
  • copy - shallow copy (map, list, set, string, char sequence, array)
  • slc - slices using slc(2, -2), slc(-2) syntax (map, list, set, string, char sequence, array)
  • slcEnd - slices the end off
  • before - tree maps, tree sets, (refers to the item before an "index")
  • after - tree maps, tree sets (refers to an item after an "index")
  • insert - inserts an item into a list like thing. (so far for lists)
  • remove or subtract or sub or minus

Maps has valueIn which is like in.

Possible future (maybe, maybe not)

  • str (turns any object into a JSON equiv string)
  • count
  • pop (list, array)
  • push
  • find - finds an object (map, list, set, string, char sequence, array)
  • findAll - finds a collection of objects (map, list, set, string, char sequence, array)
  • clone - deep copy (map, list, set, string, char sequence, array)
  • str - converts object into readable string
  • oStr - converts object into JSON
  • sub - remove an item (map, list, set, string, char sequence, array)
  • dir - list properties, methods and other information about a class
  • dice - like slice but creates lists of lists or arrays of arrays, etc.
  • divide - like dice but different - divide(2, list) would break up the list evenly into two lists.
  • sum - add a list or array of values together
  • max - find the max value in an array, map, set or list.
  • min - find the min value in an array, map set or list.
  • avg - find the avg value in an array, map, set or list.
  • mode - find the mode
  • median - find the median
  • sort - add the ability to sort things (for lists array, if not primitive then check to see if comparable, then check if it has a toString defined, then do string order on toString)
  • filter - add filtering (see DataRepo)
  • see http://groovy.codehaus.org/GDK+Extensions+to+Object
  • any
  • every
  • collect
  • each
  • each with index
  • find and findAll
  • equal (using truth)
  • notEqual (using not truth)
  • JMX support
  • EL style lang support #{} (use Ruby style) since # is less common than $
  • puts "Hello #{name.capitalize}!"
  • puts ("Hello #{cap(name}", ctx(this))
  • Create ReflectionUtils.respondsTo
  • Create ReflectionUtils.invoke
  • Create ReflectionUtils.ctx
    if (respondsTo(bird, "fly")) {
        invoke(bird, "fly", far, high);
        puts ("Hello #{height}", ctx(bird));
    }

    if (respondsTo(bird, "fly", integer, integer)) {
        invoke(bird, "fly", far, high);
        puts ("Hello #{height}", ctx(bird));
    }

  • templates built in
  • GPath style path support for any java object, map, json or dom. (I wrote this a few times for different projects)
  • ObjectGraphBuilder would be nice for testing graphs for data repo
  • queue utilities
  • add Queue as a FCC to the mix
  • Process support
  • add Regex support
  • JDBC support
  • Mongo support

Code coverage shall always be 90% or above. (It is not... mostly due to not all primitives being tested equally)

Ideas http://docs.python.org/2/library/functions.html

TODO:

  • Add comparators to Sets.
  • Missing slice tests for Maps.
  • Need empty and not empty
  • Add Arrays (len, in, idx, copy, slc, slcEnd, insert, add, conversion from collection)
  • Add Strings (split single char, split list of chars, slc, len, in, idx, copy, slc, slcEnd, insert, add)
  • Write article on universal methods
  • Add classpath:// and directory scanning support to IO
  • Write article on I/O utilities and JDK 7 FileSystem ** Add support for classpath search of resources
  • Add Reflection utilities (deep dive properties) ** UnsafeField, MapField, ReflectionField, etc.
  • Write article
  • Create universal Object to Map/List utility
  • Write article
  • Create universal Binary serializer / deserializer
  • Write article
  • Create universal JSON serializer / deserializer
  • Write article
  • Add DataRepo Support to boon
  • Write article
  • Create proxies using interface
  • Write article
  • Add support for Ruby respondsTo

Publish

Short term TODO

-[] create benchmark framework (profile?, time, stack eval) -[] write up sample for CharBuf usage -[] write up sample for CharScanner -[] write String Scanner, splits -[] Create benchmark comparing common things done in common ways compared to boon -[x] Announce Boon (basic introduction Sunday 10/21) DONE -[x] Slice article (Monday 10/22) DONE -[] Cleaned up ByteBuffer (Friday 10/26) Change to use new CharBuf port of ByteBuf -[x] Set slice (Wednesday 10/24) DONE

Longer Term

-[] Fast JSON parser -[] Fast JSON serializer -[] Add in Reflection/Dynamic invoke -[] Template Strings ${beanProp.name} -[] Refactor then fold in DataRepo code -[] Binary universal serializer to/fro GO to/for Python -[] JMX monitoring -[] Process utilities -[] Classpath file system -[] Thread mgmt libs -[] Args lib -[] Write highspeed scanner benchmark against others -[] Little HashMap for small maps that are expected to grow -[] Collections for primititves -[] add, slice, idx support for ByteBuffer and friends -[] Unsafe field access

Thoughts

Thoughts? Write me at richard high tower AT g mail dot c-o-m (Rick Hightower).

Further Reading:

If you are new to boon start here:

Why Boon?

Easily read in files into lines or a giant string with one method call. Works with files, URLs, class-path, etc. Boon IO support will surprise you how easy it is. Boon has Slice notation for dealing with Strings, Lists, primitive arrays, Tree Maps, etc. If you are from Groovy land, Ruby land, Python land, or whatever land, and you have to use Java then Boon might give you some relief from API bloat. If you are like me, and you like to use Java, then Boon is for you too. Boon lets Java be Java, but adds the missing productive APIs from Python, Ruby, and Groovy. Boon may not be Ruby or Groovy, but its a real Boon to Java development.

Core Boon Philosophy

Core Boon will never have any dependencies. It will always be able to run as a single jar. This is not just NIH, but it is partly. My view of what Java needs is more inline with what Python, Ruby and Groovy provide. Boon is an addition on top of the JVM to make up the difference between the harder to use APIs that come with Java and the types of utilities that are built into Ruby, Python, PHP, Groovy etc. Boon is a Java centric view of those libs. The vision of Boon and the current implementation is really far apart.

===

Contact Info

blog|[twitter](https://twitter.com/RickHigh|[infoq]http://www.infoq.com/author/Rick-Hightower|[stackoverflow](http://stackoverflow.com/users/2876739/rickhigh)|[java lobby](http://java.dzone.com/users/rhightower)|Other | richard high tower AT g mail dot c-o-m (Rick Hightower)|work|cloud|nosql

Clone this wiki locally