24 July 2012

How to convert your Blackberry notes to Android notes?

If you are trying to migrate from blackberry to the Android world, this article might help you. If you were heavily using notes in blackberry you find this article super useful.

Notes can be exported from blackberry to a computer using blackberry native program. After exporting them, you will see that they are stored as a msg format (the format outlook uses to store emails). Thus you need to convert it to a txt file, you can do that using msgText. However, if you are having lots of notes, task of converting each one to a text will be tiresome. What you can do is to copy the following text, save it as convert.bat file. Put the run.bat file where the msgText is, copy all notes in the same folder and run convert.bat.

%%f in (*.msg) do (

             call msgText "%%f"

You could expect txt files for each note and a folder containing a word format for each of your note. Then it's easy, you need a google drive account, upload all text files to your google drive and then install google drive application on your android.

6 July 2012

Local vs. Remote Interfaces in EJB (EJB3)

There are two different interfaces available when you are writing an EJB. One is remote and one is Local. Remote, as it name suggests is for remote client that want to remotely call (or fire) functions and get some results. On the other hand Local is designed to be used in a local environment, for example in a case if another EJB or even a POJO in your system is using that. The usage would be the same as when you want to use an EJB using its Remote interface. However, it has less headache for the server to handle that. That's the only reason you might want to use a Local interface instead of Remote interface. Local interface is not local to JVM but local like an other POJO class.

Local client view cannot be accessed:
  • When an EJB or web component is packaged in a different application's EAR packages. 
  • When a web component is deployed in a web container, and EJBs are deployed in an EJB container, and these containers are separated (even if they are running on the same machine)
These are main factors in considering a Local or Remote interface:
  • Client: if your client is not a web component or another bean do not use Local 
  • Beans & Beans: Are the beans loosely coupled? then it is a good idea to use Local 
  • Scalability: Remote is always better for scalability 
  • Local interfaces are recommended for entity beans, which helps with performance issue.
More to read: