Wojtek Gomoła Today's presentation of Lambda Expressions (C # and "emulation" in Java) for Lublin JUG reminded me of a few interesting toys that I found some time ago and forgot to write about them.
interesting feature of dynamic languages \u200b\u200bis a function:
- the ability to create structures similar to natural language
- the ability to extend the standard often used classes (usually a collection of containers) with a convenient method
- call a total tentatively "technical DSL
example, is causing such a joy to behold simplification:
kolekcja.wyrzucZNullemWPolu (" name "). sort ({e1.age> e2.age}). wytnijPierwszych (10);
As for me there is something to be excited because this is just the icing syntax and static languages \u200b\u200bwith strong type checking is only a question of creating some of the good old procedural interface strategy Utils comparation:
MyAlmightyUtils28.wyrzucZNullemWPolu (collection , "name")
and proper sequence of requests.
/ * Of course we all know that Utilsy are bad and the ugly, but what to do * /
Well, but no longer as beautiful as in the earlier example of a sexy-scripting-language.
Fortunately, there are a few interesting toys implemented in Java. Thanks for generykach cwanym tricks and use proper names they give us something more than a bit of structure known from the dynamic, weakly otypowanych languages.
op4j - a brilliant collection, which makes the tedious code becomes more readable and concise at the same time keep typing.
very basic example:
String [] emailArray = Op.on (userEmails). ToArrayOf (Types.STRING). ForEach (). Exec (FnString.toLowerCase ()). Get ();
lambda - similar toy from the stables of google. You can also look on google collections.
Mockito - our home production. Who else has not used, it should try. It is worth visiting if only to code because it is such a master documentation. The whole manual with examples is in the main JavaDocu "klaski! The formula for followed by other authors libraries - because it certainly is not for developers of commercial products;)
//==================
waiting for Java 1.7
Well, certainly on the certificates will be new arcyistotne questions designed to checking if the culprit is able to distinguish: the internal closure of the class and from the code niekompilującego P
0 comments:
Post a Comment