Saturday, August 21, 2010

Disadvantages Or Challenges Of Agile

Practicing Agile come with its own challenges, eventhough everybody boasts that they practice Agile, every team has developed their own flair towards Agile. The degree varies on the practices followed. 

Advantages of Agile are its Disadvantes too, Like

  • No Room To Code Based on Future Needs

In Waterfall model, We go through a design phase, and consider all the future requirements, with the goal to design a system which will solve all the current as well as future requirements.

Agile does not allow to foresee in future, but only Code for existing sprint or the User stories.

Workaround : Experienced programmers will always use Loose Coupling,  Dependancy Injection, layered and modular programming. This is where Juniors programmers have to be mentored.

  • No Documentation

In Agile, there are User Stories, which further break down in Tasks. Each User Story should ideally last for 2-3 days. But there is no end client Documentation as such.

Workaround : ScrumMaster should enforce proper use of JavaDocs.

  • Active Customer Involvement

Active involvement of BAs and Customers are needed, as Sprints are short, to verify in real time that release is as desired. This puts a lot of pressure on Customer, to make sure he is crisp and clear on his requirements at each phase.

Thursday, June 10, 2010

Flex GoodNess : How to bind TextInput data to a VO behind

Recently , I was looking for a way to update the VO(Value Object) when the TextInput value changes.

With Flex4, We can use Two way binding (usage: @{ } )

With Flex3, We can use the ValueCommit event to update the backend VO.

Value commit event gets fired when the TextInput control value changes through UI interaction or programmitically.

   1: //if we have a datagrid name dg, then a two way binding will look like this, Note: @ symbol is the main one
   2: <s:TextInput text="@{dg.selectedItem.name}"/> 
   3:  
   4: //Also if its Flex 3 ,where two way binding is not available, we can use the value commit event, to update the value ourself
5: <mx:TextInput id="txInput2" text="{dg.selectedItem.email}" valueCommit="txInput2_valueCommitHandler(event)"/>



Enjoy FLexing!!

Friday, June 4, 2010

Flex Goodness : NaN and Number

In flex, instead of using primitive datatypes like ent it is recommented Number datatype which supports double precision point floating number.

When a Number is not initialized, its value is NaN (Not a Number). Following are some methods which can be used to explore more about Number.

   1: var num:Number //this assigns a NaN value to it
   2: trace isNaN(num) //prints true
   3: trace int(num) //converts number to int and prints 0
   4: trace uint(num) //coverts number to uint   5:  
   6: var iStr:String = "1000"
   7: var convNum:Number = parseInt(iStr) //converts String to Number
   8: var convNumFloat:Number = parseFloat(iStr) //converts String to a float number

Enjoy Flexing!!

Thursday, June 3, 2010

Flex Actionscript Goodness : Finding and Removing a Object from ArrayCollection(IViewCursor and Sort)

There is always a need to find a particular object or remove it from the ArrayCollection class based on a various member variable conditions.

IViewCursor and Sort classes of mx.collections are a perfect fit for it

Goal: Find employee by empId and remove it

Step1 : Lets Create a ArrayCollection of two Employees

   1: public class EmployeeVo{
   2:     var empNo:String
   3:     var firstName:String
   4:     var lastName:String
   5: }
   6:  
   7: var empVo1:EmployeeVo = new EmployeeVo()
   8: empVo1.empNo=1
   9: empVo1.firstName="john"
  10: empVo1.lastName="tyson"
  11:  
  12: var empVo2:EmployeeVo = new EmployeeVo()
  13: empVo2.empNo=2
  14: empVo2.firstName="ram"
  15: empVo2.lastName="balram"
  16:  
  17: var empCol:ArrayCollection = new ArrayCollection()
  18: empCol.addItem(empVo1)
  19: empCol.addItem(empVo2)
  20:  
  21:  
  22:  
  23:  

Step2 : Sort the employee Vo Class by empId And Find it / Remove it

Note: Sort it needed first in order to use the IViewCursor


   1: import mx.collections.IViewCursor
   2: import mx.collections.Sort
   3: pubic function findAndDeleteEmp(empId:String):void{    
   4:    addSort()
   5:    var cursor:IViewCursor = empCol.createCursor()
   6:    var searchEmpVo:EmployeeVo = new EmployeeVo()
   7:    searchEmpVo.empId = empId
   8:    var isExisting:Boolean = cursor.findAny(searchEmpVo)
   9:    if(isExisting){
  10:        //to get the found object
  11:        var foundEmpVo:EmployeeVo = cursor.currentItem as EmployeeVo
  12:        //to remove the found object
  13:        var deletedObj:EmployeeVo =cursor.remove() as EmployeeVo
  14:    }
  15: }
  16:  
  17: public function addSort():void{
  18:    //Add Sorting to Array Collection
  19:     var fieldName:String = "empId"
  20:     var sortField:SortField = new SortField(fieldName, true,descending);
  21:     var sort:Sort = new Sort();
  22:     sort.fields = new Array(sortField)    
  23:     empCol.sort = sort
  24:     empCol.refresh()
  25: }

Step3: Done!! Hurray!!!

Thursday, May 27, 2010

Flex Actionscript GoodNess: AS equivalent of Java Hashmap / Hashtable

With Java being the my core language, it always puzzles me why is there is not good Hashtable functionality..

There are lot of equivalents though, but I still miss the Java Hashtable.

Here are the Options

1. Associative Arrays

   1: var params:Array = new Array()
   2: params.firstName = txName.text
   3: params.lastName = txLName.text
   4: displayValues(params)
   5:  
   6: public static const FIRST_NAME:String ="firstName"
   7: public static const LAST_NAME:String = "lastName"
   8: //Retreive values From Associative Array
   9: public function displayValues(params:Array):void{
  10:     var firstName:String = params[FIRST_NAME]
  11:     var lastName:String = params[LAST_NAME]
  12:     trace(firstName)
  13:     trace(lastName)
  14: }





2. flash.utils.Dictionary



   1: import flash.utils.Dictionary
   2:  
   3: //Set values to dictionary
   4: public function dictionaryDemo(fName:String, lName:String):void{
   5:     var aDict:Dictionary = new Dictionary()
   6:     aDict.firstName = fName
   7:     aDict.lastName = lName
   8:      displayValues(aDict)
   9: }
  10: public function displayValues(aDict:Dictionary):void{
  11:     trace(aDict.firstName)
  12:     trace(aDict.lastName)
  13:  
  14: //You can also iterate over a Dictionary
  15:     for (val in aDict) { 
  16:         trace ("KeyVal pair is " + val + " = " + aDict[val]); 
  17:     }
  18: }
  19:  


What do you guys think, which one is better Associative Arrays or Dictionary..



By default, I have observed that actionscript Object type behaves like dictionary.

Friday, May 21, 2010

Started Using Windows Live Writer

For a while I was wondering on how to give more curb appeal to my blog , make it more attractive at the same time making it easy to upload images, links and tweeting about it.

Finally I stumbled upon Windows Live Writer which is Free and allows to write the blog , do the images, tweets, facebook and other social networking sites

 

Jellyfish This is a sample Jelly fish photo to demonstrate the photo ability

Windows writer seems to be a very good software to solve the Blogging issues and is a boon for Bloggers.

Some useful links to get more out of Windows Live Writer.

Five Things To Do After Installing Windows Live Writer

Seven great plugins for windows live writer

Enjoy!!

Wednesday, May 5, 2010

Flex Actionscript GoodNess :Changing States in Flex from ActionScript

States are a breeze in Flex4, they are so elegant and simple to use.

If you are using Cairngorm or other model, you are bound to change the State in Flex from Command Object through actionScript.

Here is how to change the states..

e.g
import mx.core.FlexGlobals

//then Navigate to the component in a top down hierarchy and change the //currentState property

FlexGlobals.topLevelApplication.currentState="AdvancedSearch"


Done!! Hurray!!