Groovy closure – will it work?

Lets say we have Groovy class like this:

  2. class Foo {
  4. def bar(myClosure) {
  5. myClosure(this)
  6. }
  8. private def bas(myName) {
  9. println "hello from ${myName}"
  10. }
  11. }

and I am wonder what should happen if I execute this line of code:

  2. new Foo().bar {
  3. it.bas("Steve Zissou")
  4. }

Should it throw exception that I want execute private method? But this method is execute inside Foo object instance. So, should it print

hello from Steve Zissou

Unfortunately question is still open because Groovy private method / field bug. Or maybe is time to start using Scala and Lift?

    Gmail – global “mark as read” solution

    Ok, gmail i great email client but there is no direct option to select all mail as read. After back to work from summer holidays i found about 500 unread email (mostly from mailing list - nice work guys ;)). So I started digging an I found this solution:

    1. search for parameter "is:unread"
    2. on search result list from select options choose "all"
    3. after that "Select all conversations that match this search" option should appear - click it
    4. from "More option" menu selct "mark as read"

    After that all emails should be mark as "read".

    Frontend / Backend misunderstood

    Recently my friend come to me, look in project that I am involved into and said: "uuuu, its wrong - there shouldn't be front-end and back-end packages in your project". It was hard to me to admit that this names were wrong for naming main / administration modules . According to Wikipedia:

    In software architecture and software design, the front-end is the part of a software system that interacts directly with the user, and the back-end comprises the components that process the output from the front-end. The separation of software systems into "front-ends" and "back-ends" is an abstraction that serves to keep the different parts of the system separated.

    so there is no doubt - front-end and back-end are incorrect in this case.

    I used this names because in php Symfony framework they are using this naming convention. Well, we learn whole life.

    Ps. Thanks Michal 😉

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.