středa 18. srpna 2010

Injecting Mockito mocks into a Spring bean

I would like to inject a Mockito mock object into a Spring (3+) bean for the purposes of unit testing. My bean dependencies are currently injected by using the @Autowired annotation on private member fields.

Howto do it simple with XML configuration:

<bean id="dao" class="org.mockito.Mockito" factory-method="mock">
    <constructor-arg value="com.package.Dao" />

It's pretty elegant.

neděle 30. května 2010 is a online version of SuperMemo program which is legendary desktop program developed by Piotr Woźniak.

The application itself makes good impression with professional design. I take a look on usage.

Lesson overview is looks good on first view. Each lesson has nice description, rating, nice picture and  icon which tells me, if a lesson is free or not. After first look I try to find what lesson are offered. And here comes the problem. Filter feature is not intuitive. I see recommended lessons, Top 10  and user lessons. After a while I spot a menu with 'Course categories'. This displays a page with tree menu - languages, other and user courses. No sorting, search is problematic (search for history finds only lesson not from users). To find what this application offers that is a little difficult.
I expect a lesson filter which gives me impression if same lesson is present or not, if it's free, which language it uses, ...

After while I found a interesting lesson which I subscribed. I searched a introduction to the application but I found none. No suggestion how to use it, how the learning works.
Learn part is split into three parts → Learn plan, Course content and flashcard display.

Learning itself is good designed. You can see big experience in UI. Flashcard has usual control → Show answer, rate your knowledge options and Next flashcard button. On Next button is displayed information when flashcard will be repeated.

Learn plan contains flashcards list planed for todays learning. It consist from three parts as Repetition, New material and Drill. The detailed learn schedule is also available (under Welcome → Schedule of repetitions).

Information about your current progress is also available in lesson statistics.

And finally lesson configuration:

SuperMemo is a nice application. You can see 10 years of development here. It offers settings for each lesson, where you can adjust speed of learning progress for your skills. You can see your lesson statistic and flashcard schedules. The drill part is also important. After proceeding scheduled flashcards you can repeat todays portion and improve your knowledge.
What I don't like is that the flashcard stays in order while learning or drill. There is no flashcard shuffle. So you will learn the flashcard  order which is not wanted. You don't want to remember the information from a flashcard only in that case that another flashcard precede.

pátek 30. dubna 2010

Learn simple

I would like to improve my language knowledge. I know german and english already. But my english could be improved. It's good only for reading technical texts, but nothing else.

There for I am looking for one nice application, which will improve my english easily. I am expecting a web 2.0 application, where I simple learn new vocabularies, idioms, grammar, ... I would appreciate access possibility from cell phone.

So where I can find list of those software? Wikipedia of course. Under Flashcard Software I found following:
Know I will check these applications and see what they are offering.

Update: And also take a look on Google search results:

úterý 30. března 2010

How to succeed in SCJP

One year ago I decided for certification in Java. I passed the exam last week. Now I would like to share my experience in two advices.

1. Have a deadline
Without a deadline the study takes to long. You will never know everything. Don't try to replace compiler.

2. Have a good learn resource.
It's the core. You don't want to read 700 pages books. Keep it short and efficient. The first book is SCJP Sun Certified Programmer for Java 6 Exam 310-065. This book awesome summary for each chapter, which is ideally study material. Read it first and if you don't understand the content read the whole chapter.

Second study source is Whizlabs certification preparation software. For 50$ you get a account with 8 mock exams. If you keep score over 85% you are prepared for the exam.

Finally don't forget you need just 58% to pass.