Sunday, February 26, 2012

Maven EAR plugin

Maven EAR plugin is a cool solution to assemble your EAR with modules, descriptors and libs.

Though it is bit hard to get info about the plug-in and its features, this tool can be used to assemble a fairly custom EAR as you do with an ANT script.

If the configurations are not enough for a custom assembly, you can use Maven assembly plugin which is as good as Apache ANT.

Architecture views

We kicked off a new project few weeks backs. This is very first project which I'm going to get hands-on experience in software architecture and design (in a formal way ;).

When we are wearing the developer hat, it is bit hard to accept that architecture and planning is the most important task and it cuts down a significant development time compared to a project without architecture and designin.

Building an enterprise application is complex and hard as building a large shopping complex or a warship. But surprisingly industries such as construction or electronic don't fail as much as software do !

The reason behind this fact is ARCHITECTURE.

But architecture is not a simple thing which can be achieved with minimum effort. It is collection of aspects which draw the boundaries for further design or implementation. These aspects are called Architecture Views.

There is a useful book architecture documentation from Software Engineering Institute of CMU.

Hopes this book helps you to gain a good knowledge on software architecture and formal documentation.   

Tuesday, February 14, 2012

Regular Expression for printable page ranges.

Last week we got a  requirement to enable printing for our student portal which was developed using Adobe Flex. And all the documents of the portal is on Flex. So our approach was to use Flex Printing.

Our print dialog box has a text box where the user can enter the range of pages to be printed (just like all other applications which has printing ;) ). I was searching for a regular expression which validates the page range pattern. While sufring web I found a cool app where you can write the regular expression and write different test cases agains that. And the interesting thing is it has been written in Flex. So if you are using Flex then you don't have to worry about platform specific stuff. (If the expression is correct in this app then it should obviously work in your Flex application.

And there is a good collection of pre-defined regular expressions which are usable in many cases. I could find one for my requirement as well. But since I needed further more restrictions I had to came up with my own one.


This is my solution :) 
/^([1-9][0-9]{0,2}|[1-9][0-9]{0,2}-[1-9][0-9]{0,2})(,([1-9][0-9]{0,2}|[1-9][0-9]{0,2}-[1-9][0-9]{0,2}))*$/
which validates a pattern like 1,2-5,6,7,12-15

You can access the aforementioned test bed using the url http://ryanswanson.com/regexp/#start


Monday, December 19, 2011

Testing Apple In-App Purchase (IAP)

These days I'm working on an iPad application. We are implementing a store application and In-App Purchase is an important part of it. Although the applications can be tested on iOS simulators, applications with IAP operations can't. Running your application on a physical device is a must in this case.

IPA is a process which involves purchasing items from AppStore. So there should be a sand box environment to test these applications. iTunes provides a sand box for this purpose. Basic information on this can be found here. And there is an Apple technical note on this which is very useful.

But after following all these articles I couldn't get my code running !!!. I was doing a very simple task, that is fetching IAP items for my application. But I ended up with getting my app identifiers  in invalidProductIdentifiers array of the returned SKProductsResponse object. And I couldn't find the reason for this.

My app was in iTunes in Waiting For Upload status and there was a non-consumable in-app for that app in the Waiting for Screenshot status and cleared for sale.

Fortunately one my colleagues deleted the application from iTunes accidentally :) So I had to create stuff from the scratch (App Id, App in iTunes and IAP entries). But this time I kept my app's status in Prepare for Upload rather than promoting it to Waiting For Upload status and....... this time it worked !

But I couldn't find an article describing the status configurations for IAP testing.

If you guys find any official Apple article on that please let me know.