2013-04-06

express-IOC

https://github.com/whunmr/express-ioc
https://github.com/johnelf/express-mvc
https://github.com/whunmr/express-orm



Framework design:
  • less intrusiveness
  • simple to use
  • Flent API: User.find_all().includes(Article.class);
  • Convention over configuration

DEMO CODE
git@github.com:whunmr/express-orm.git


IMPLEMENTATION of Lazy List


  • allOf
  • anyOf
  • both
  • either
  • describedAs
  • everyItem
  • is
  • anything
  • hasItem
  • hasItems
  • equalTo
  • instanceOf
  • any
  • not
  • nullValue
  • notNullValue
  • sameInstance
  • containsString
  • endsWith
  • startsWith
  • hasProperty
  • samePropertyValuesAs
  • array
  • hasItemInArray
  • arrayContainingInAnyOrder
  • arrayContaining
  • arrayWithSize
  • emptyArray
  • hasSize
  • empty
  • emptyIterable
  • isIn
  • isOneOf
  • containsInAnyOrder
  • contains
  • iterableWithSize
  • hasEntry
  • hasKey
  • hasValue
  • closeTo
  • comparesEqualTo
  • greaterThan
  • greaterThanOrEqualTo
  • lessThan
  • lessThanOrEqualTo
  • hasToString
  • typeCompatibleWith
  • eventFrom
  • isEmptyString
  • isEmptyOrNullString
  • equalToIgnoringCase
  • equalToIgnoringWhiteSpace
  • stringContainsInOrder
  • hasXPath
  • matcher1
  • matcher2
  • matcher3
  • firstMethod
  • secondMethod
  • notStatic
  • notPublic
  • goodMethod
  • anotherGoodMethod
  • wrongReturnType
  • generifiedType
  • noGenerifiedType
  • crazyType
  • withParam
  • withArray
  • withVarArgs
  • withGenerifiedParam
  • withExceptions
  • documented
  • subclassMethod
GUAVA
moco:

cglib introduction:

dynamic-proxy:
git@github.com:whunmr/java-demos.git

intelliJ IDEA
foreach:
  • iter (for each..in)
  • itin (for..in)
  • itli Iterate List itar Iterate array
  • ritar reverse order

WORKSHOP about dynamic-proxy/cglib/javassist
a. how to using instrument lib
  1. gradle clean idea
  2. in instrument folder, execute gradle jar
  3. setup configuration so we can using the instrument agent jar, when running junit test. In IntelliJ IDEA, Run-->Edit Configurations…-->Defaults-->JUnit: set "VM Options:" to -javaagent:./instrument/build/libs/instrument.jar


b. get the task from here https://github.com/whunmr/java-demos

c. find //TASK1 //TASK2 //TASK3, and finish the //TODOs in the task.


FUTHER READING:
Inside the Java Virtual Machine