Monthly Archives: October 2004

Persistable bean values in Spring BeanFactory

I was thinking if the following scenario could be achieved in Spring BeanFactory:

  • use property placeholders inside the definitions ( i mean ${prop.value})
  • apply programmatically a PropertyPlaceholderConfigurer to obtain the real values and retrieve the beans
  • apply another PropertyPlaceholderConfigurer and obtain another set of beans

Actually this behavior is not available. After applying the first PropertyPlaceholderConfigurer the values ${prop.value} are lost foreever, so applying another PropertyPlaceholderConfigurer will do nothing in fact.
The solution I see for solving this are:

  • either clone in a way the BeanFactory and apply PropertyPlaceholderConfigurer on the clone (till this moment I couldn’t figure out a way to implement this)
  • or create a custom BeanFactory (probably by extending DefaultListableBeanFactory) that will be able to keep the original values after applying a property placeholder

Does anybody see any other solution for this?



Filed under Uncategorized

Independent IoC-ish unit testing

The following is for the moment only a disertation on the possibility to ease the development of unit testing for the product I am working now. As a preamble I would say that in order to be able to test some parts of the product a developer would need a very long/complex/repetitive fixture. The first solution that came to me was to create unit tests using an IoC solution. Interesting… but this will link my test to a IoC solution (I like Spring Framework very much [smile/], but I don’t like too much dependency). A better solution would be to have a single test base that according to some other configurations to be able to load the required context. But this will not completely solve the dependency problem and may result in time in a large number of different base unit tests (specialized in different initialization types). What if I will remove completely the dependency to the IoC from my tests? How? …. using AOP. As you probably know both TestNG and JUnit provide very clear points where the fixture is (for those who don’t know this: TestNG declares a fixture method using a Configuration annotation; JUnit provides this by means of setUp method in TestCase or by extending TestSetup). Right now all I have to do is to write down some simple aspects that will initialize the test unit with the required info. For the moment the only AOP solution (I might be wrong here [sigh/]) that is able to cover both cases (normal pointcuts and annotation based pointcuts) is AspectWerkz. So starting with a solution that presented a high dependency I have finished with: any IoC solution (Spring, Pico, etc), any unit testing framework (TestNG, JUnit) and AspectWerkz. What do you think about this? (if you see any possible drawbacks don’t let me go a wrong way [smile/]).

Leave a comment

Filed under Uncategorized

Netbeans … what’s that?

This morning I have received a proudly announcement about the early availability of Netbeans 4.1. Wow, stop for a moment and read again. Oh yes, 4.1. I think the guys feel how they are missing their targets and how far behind they are against the other competitors and I guess they decided to recover this by launching numbers. Yes indeed, numbers. Netbeans 4.0 is not yet out and they already announce a 4.1.
I don’t consider this a bad strategy (take for example Eclipse which is very dynamic about their releases, or even IntelliJ IDEA), but do not forget that they have praised this release for about 1 year. I guess that, between the lines, we can read: “Hey guys we have missed it again. Don’t bother for 4.0 as we already realized there will be soon a 4.1. Go for that one instead.”


Filed under Tools

Feelings from the (Apache) Forrest!

In my search for generating project documentation I have reached a forrest (thanks to an anonymous suggestion). Right now, I am returning from some 2 hours wandering in the forrest… Apache Forrest. The walk seemed interesting, with fresh air (other types of site organization and skins) and with the trees and flowers I like all over (xdoc based documentation source, Ant based process, XSL transformations). But, unfortunatelly not completely relaxing. After figuring out the paths, I have tried to customize my way (customize the site look), but with no real success. Much of the indicators (custom properties – like colors, headers) are in place but are pointing to dead-ends (the corresponding XSL fragments are either not working or they are missing completely). I sat for a moment in the first clearing I have found and I was thinking that with all this beauties around maybe it would be great to continue. I just came out for a moment to tell you that I am not yet lost!
This was my first metaphoric walk in the Apache Forrest. I will go deeper into its XSLTs and I will be back with a more technical description. Maybe I will try some more uptodate version (even if it is a night build).

Generating documentation series:

PS:I hope that by now you have already realized that I am far away from a web developer so for me hacking into html, css and alike is unfortunately quite a killer.

Leave a comment

Filed under Tools

Firefox hack

For about 2 years I have become an unusual Windows user – at least some may consider this, cause I was not using IE and Outlook anymore (damn, I must confess that from time to time I fire IE to visit Flash enabled pages and to print some pages – it still renders better). So, I was using Mozilla suite for a long time – yep everything from Mozilla worked oke with me (browser, mail client, etc). I have tried from time to time Firefox and also Thunderbird (I still think this last little brother doesn’t equal the Mozilla Mail features, but it will). Uptill version 1.0PR I have found big problems using Firefox, but the last preview release touched my heart, convincing me to give it an extensive chance. So here I am using Firefox as my default system browser and Mozilla Mail as my default mail client.
From time to time – as I always have liked to have things happening exactly as I expected on my computer – I had to go deeper in the confs of Mozilla and Firefox (I have posted here some other tricks). After moving to Firefox PR1.0 I have experienced some problems with the handling of mailto URIs. Even if Mozilla Mail is my system default mail client, Firefox kept fireing Outlook – and surely I don’t like this.
I have scanned the available infos and I have found that even if Mozilla registers correctly as the system mail client it doesn’t correctly register for handling mailto URIs. The suggested solution was to change the file type association of (none) URI mailto to Mozilla Mail client. Unfortunately this doesn’t work as the suggested:

mozilla -mail %1

which in fact is translated to

mozilla -mail mailto=mail_address,subject=mail_subject

doesn’t really trigger a new mail composer. Continuing to search through Mozilla documentation I have found out that the correct command line should look like:

mozilla -compose to=mail_address,subject=mail_subject

At this point it may seem that there is no solution as the URIs parameter is mailto (which in fact should be to).
But wait! I don’t give up so easy. Searching again I have found a Mozilla/Firefox mozex plugin which allows some external programs configuration. In the documentation page is said there is no need to configure mozex as long as you already did the previous trick. Unfortunately again, this didn’t work. Something else that haven’t work at this step was the mozex preference page in Firefox, and so I had to install it under Mozilla (where the preferences are in place) and go to the trick a like most about:config. From there I have extracted the mozex preference keys. Armed with these I go back to Firefox and using again about:config I have set

mozex.command.mailer mozilla -compose to=%a,subject=%s

and …. TA DAAAA: now it works. Even if this full configuration took me a while I think it’s worth it: I have my things doing back what I expect.

Mozilla/Firefox related posts

Leave a comment

Filed under Tools

Writting documentation [revisited]

A few days ago I have mentioned my ramblings on document generation tools. After trying the solutions described in the post (except the solution suggested by Andreas Mecky and Matt Raible, not because I do not like it, but I am still waiting for the Eclipse plugin), this morning (in fact an hour ago) I have started to write down my proposal for document generation solution. A few minutes later I was disturbed by the sound of my mail notification: a comment was just posted on this blog. Subject: Generating project documentation. Suggested solution: Apache Forrest. So I saved the few lines I have just written, fired Firefox and here it goes: Apache Forrest. I few minutes later a demo site was generated automatically by Forrest. , which did in background some interesting stuff (created the documentation directory structure, copied some document templates and a skin and voila!).
A quick look in the internals of Apache Forrest revealed that it uses xdoc as page sources (it even gives you some DTDs), offers an Ant build file (damn this is nice [smile/]) and includes some site templates which are quite clean. The first two arguments are encouraging me to continue investigating (they are according to my goal – but about this I will write in the Writting documentation [final] later). I have to pass again over all my requirements and see how Apache Forrest behaves, but for the beginning I must say I am quite satisfied (even more than satisfied [smile/], and so I was joking about disturbing: thank you very much Anonymous for your suggestion. Please come back to see what’s happening next [blink/]).
Unfortunately this will make me be a little late with the first public release of the new and cool rjxconfig tool, but be sure that when I figure all about generating site documentation it will be here!

1 Comment

Filed under Tools

What should I index for you today???

I feel very sorry that I must come again to this subject but my anger has grown in the last hours. The product under discussion is indeed Google Desktop Search, and all of this just because there is a lot of movement around it. The download page states that Google Desktop Search will index for you Outlook/Outlook Express mail, AOL IM, IE, Word, Powerpoint, Excel and text. Wow… a lot of file types! Let’s see: should I index your Outlook mails? Nope… I use Mozilla. Should I index your AOL IM? Nope… I use GAIM (he he – I am gonna trick you as GAIM saves discussion as text files). Should I index your IE? Ahhh… nope again. I am using Firefox. Should I index for you Powerpoint, Excel and Word? Ahhh nope, there is no need for these as I have about 2 ppts, and maybe 10 docs. Now I guess I should ask the program: Are you able to index my mbox mails? ahhh, sorry no. Are you able to index my PDFs? ahhh, sorry no. Hmmm, I think you cannot help me. Damn, and everybody is screaming about you! What is all this buzz about???

Update: I think I have found an usage for it: index my 1GB of java sources. At least this I can take from him.

Leave a comment

Filed under Uncategorized