Monthly Archives: December 2008

How to Rate a Software Developer

I came across this nice article. It is a must read article. i bet.

Link: http://www.realsoftwaredevelopment.com/how-to-rate-a-software-developer/

How do you rate a software developer?  That’s a fantastic question!  There are so many theories out there, and there are so many forms that HR teams try and come up with to help you conduct performance review.  However, what really makes a great developer?  And if you are a Software Developer, how can you improve your career today!  Below is my bible for rating the developers on my team.  By following these tips and rules, you will improve your status from “good developer”, to “great developer”!

  1. Time spent writing great code
    It’s not about the quantity it’s the quality!  However a twist to this is: It is about the quantity, and the quality.  Far too many times you will get one of two scenarios.  

    In scenario A, you have a developer that pumps out code like mad, things seem to be working… then bugs start happening, you don’t know why, seems to take forever to fix!  Or they fix 10 and cause 5 more!  But you get a lot of code…

    In scenario B, you have a developer that seems so smart!  You interview him and he knows everything about everything, can speak the theory up and down!  Yet for some reason, you have assigned him three features, and three weeks later, he is still working on something that should have been done in 3 days!  You are so confused!  He is so smart! He knows everything about generics, multi-threading, and can explain pointers to your grandmother and make her excited to want to code! Why is nothing getting done?!

    In your dream scenario, you get great code!  Great code is done by a great developer that is super smart, knows what quality code is, and writes code like Tony Hawk rides his skateboard.  It looks so natural!  He or she is almost entertaining to watch!  They also get it done at blinding speeds!  They know how long each problem should take, and do not get caught up in finding the world’s best solution, that has multiple threads and layers, to write a game of pong.  Bugs are nonexistent because they write unit tests for themselves, and just plain can code in their sleep!  These guys are worth their weight in GOLD! 

  2. Interpretation of the problem

What is the difference between List , Set, Container and Map

Containers:
Containers are dynamic and have no limits. They can contain elements of
almost all data types: boolean, integer, real, date, string, container,
arrays, tables, and extended data types. However, objects may not be stored
in containers.

Containers in AX are used very often. It’s easy to work with them. But…
data in containers are stored sequentially, and thus retrieved sequentially.
This means that containers provide slower data access if you are working with
_large numbers_ of records. In case of large numbers of records use temporary
tables.
List:
Lists are structures that may contain any number of elements that are
accessed sequentially. Lists may contain values of any X++ type. All the
values in the list must be of __the same__(this is the main difference
between lists and containers) type, given in the creation of the list. The
implementation of lists is such that traversal of the list elements is __very
fast.

Take a look for example at class Dialog addControl() method.
There controls are stored in ctrls List.
Map:
A map is a data type that associates one (key) value with another value [An
analog - a small table in memory with two fields: Keys, Values]. Both the key
and value values may be of any valid X++ type, including objects. The types
of the key and the value are given in the declaration of the map. The
implementation of maps is such that access to the values is _very fast_.

Don’t confuse map X++ types with Map objects in AOT, wich are used for
mapping tables with similar structures of fields
-

Set:
The functionality of Sets is similar with list.  A Set is just an unordered list of items, while a list of items held by a Map
are indexed via via a key.
Take look at
\Classes\sysLabel\LabelModuleId().

In any case use Search in AOT\Classes or Forms and look how are used
different X++ types in AX.

Map in Axapta

There are two kinds of maps in AX. There is a collection class called map,
which basically just maps a set of keys to a set of values.

And then there is the table map, which is kind of a interface for individual
tables. For example all table holding address information are parts of the
the AddressMap table map.

How to use Sets data structure in Axapta

The Set class is used for the storage and retrieval of data from a collection in which the values of the elements contained are unique and serve as the key values according to which the data is automatically ordered.

Scenario:

I have this requirement to track the records that are modified by user and  i  need to take action on mofdied records

Solution with Sets
Declare set in Form\class declaration
Set                         setChangedRecord;

Initialize set on Form\DataSource\init as follows:
setChangedRecord     = new Set(Types::Record);

Store records in set on Write method of the data source as follows

 if (!setChangedRecord.in(purchReqLine))
    {
        setChangedRecord.add(purchReqLine);
    }

Traversing of records in Set:

Following is the way of traversing records from Set

SetEnumerator   setEnumerator    = setChangedRecord.getEnumerator();

 while (setEnumerator.moveNext())
            {
                reqLine = setEnumerator.current();
                if (!reqLine.IsSaved)
                {
                    purchReqLineLocal = PurchReqLine::findRecId(reqLine.RecId,true);
                    purchReqLineLocal.IsSaved = true;
                    purchReqLineLocal.update();
                }

            }

How to set focus on the run base dialog field

Problem Statment:
Hi,
I have this requirement, i have a run base class with a dialog Field. i need
to validate the vaue in the field and i need to set focus on the field if the
value is not validated. The problem is dialogfield does not have setFocus
method.
Can any one help me out in this regards.

Solution :
As you right noticed really dialogfield doesn’t have setFocus. And not only
setFocus. Dialog was developed just for simple user input.
The better decision in this case is creating separate form where you may
override every control’s event and in a dialog method of your runBase class
call this form.
 
Take a look for example at \Classes\WMSShipmentShip and
> \Forms\SysProjectFilter.

If you eagerly wish set focus in dialog there is nothing impossible

// here we achieve myCtrl
public void dialogPostRun(DialogRunbase dialog)
{
    super(dialog);

    myCtrl =
dialog.dialogForm().formRun().control(dialogTransDate.control().id());
}

in method where you validate:
myCtrl.setFocus();

But I’d like to say again
the better solution is sepate form

SOFTWARE ENGINEER’S LIFE…

ONE BEDROOM FLAT… AN INDIAN SOFTWARE ENGINEER’S LIFE… 
Article By an Indian SE who was in US. 
  - A Bitter Reality 

As the dream of most parents I had acquired a degree in Software Engineer and joined a company based in USA, the land of braves and opportunity. When I arrived in the USA, it was as if a dream had come true. 

Here at last I was in the place where I want to be. I decided I would be staying in this country for about Five years in which time I would have earned enough money to settle down in India. 

My father was a government employee and after his retirement, the only asset he could acquire was a decent one bedroom flat. 

I wanted to do some thing more than him. I started feeling homesick and lonely as the time passed. I used to call home and speak to my parents every week using cheap international phone cards. Two years passed, two years of Burgers at McDonald’s and pizzas and discos and 2 years watching the foreign exchange rate getting happy whenever the Rupee value went down. 

Finally I decided to get married. Told my parents that I have only 10 days of holidays and everything must be done within these 10 days. I got my ticket booked in the cheapest flight. Was jubilant and was actually enjoying hopping for gifts for all my friends back home. If I miss anyone then there will be talks. After reaching home I spent home one week going through all the photographs of girls and as the time was getting shorter I was forced to select one candidate. 

In-laws told me,to my surprise, that I would have to get married in 2-3 days, as I will not get anymore holidays. After the marriage, it was time to return to USA, after giving some money to my parents and telling the neighbors to look after them, we returned to USA. 

My wife enjoyed this country for about two months and then she started feeling lonely. The frequency of calling India increased to twice in a week sometimes 3 times a week. Our savings started diminishing. After two more years we started to have kids. Two lovely kids, a boy and a girl, were gifted to us by the almighty. Every time I spoke to my parents, they asked me to come to India so that they can see their grand-children. 

Every year I decide to go to India. But part work part monetary conditions prevented it. Years went by and visiting India was a distant dream. Then suddenly one day I got a message that my parents were seriously sick. I tried but I couldn’t get any holidays and thus could not go to India. The next message I got was my parents had passed away and as there was no one to do the last rights the society members had done whatever they could. I was depressed. My parents had passed away without seeing their grand children. 

After couple more years passed away, much to my children’s dislike and my wife’s joy we returned to India to settle down. I started to look for a suitable property, but to my dismay my savings were short and the property prices had gone up during all these years. I had to return to the USA. 

My wife refused to come back with me and my children refused to stay in India. My 2 children and I returned to USA after promising my wife I would be back for good after two years. 

Time passed by, my daughter decided to get married to an American and my son was happy living in USA. I decided that had enough and wound-up every thing and returned to India. I had just enough money to buy a decent 02 bedroom flat in a well-developed locality.

Now I am 60 years old and the only time I go out of the flat is for the routine visit to the nearby temple. My faithful wife has also left me and gone to the holy abode. 

Sometimes I wondered was it worth all this? My father, even after staying in India, had a house to his name and I too have the same nothing more. 

I lost my parents and children for just ONE EXTRA BEDROOM 

Looking out from the window I see a lot of children dancing. This damned cable TV has spoiled our new generation and these children are losing their values and culture because of it. I get occasional cards from my children asking I am alright. Well at least they remember me. 

Now perhaps after I die it will be the neighbors again who will be performing my last rights, God Bless them. But the question still remains ‘was all this worth it?’ 

I am still searching for an answer…………….!!!! 

By an Indian SE who was in US.

 

Set focus on particular row

Problem statement:

I  have this requirement that i m needed to do validation on the records in the grid and i need to set focus on the row which contain error. I m validating by looping through the queryRun object on the data source, i just don’t get the way to set focus on the particular row.

Resolution:

You can create an extra table buffer variable and fill it with the record you want to set focus on then run the following line of code: yourDataSource_ds.findRecord(yourNewTableBuffer); so if for example we are in SalesTable and yournewTableBuffer has the record with sales id: so_01122 then the grid focus will go on that record.

Follow

Get every new post delivered to your Inbox.

Join 54 other followers

%d bloggers like this: