Hi trinadh sura,
Pls bear with the presentation style, am in a good mood now..................


 I am not sure if I was dreaming, but  I was among tables in AOT of Axapta. I 
could see hundreds of tables with tons of data in them. Many of the fields in 
the table were labeled with different  names, though the category of the 
contents  in the column/fields of each were the same, just like among humans we 
are  labeled as Christians, Muslims, Hindus etc. though we are all Man.  
 While I had my journey through the  silent Paths of Dynamics-AX -AOT, I could 
see several classes chunked with  beautiful localization business logic. These 
classes are there to Work on the  data available in the table columns. When I 
looked deep inside the classes I  could see that, in some cases the classes are 
not using the real name of  table column to access data, but something else. 
Say like the  SocialSecurityNo(SSN). of US to identify the individual. I 
wondered and asked  the class itself about this. She told me that the same 
business logic inside  her can work upon many different table fields which hold 
similar  data, had their name been THE SAME. But this is not possible in  
practice. So she achieves this using a mechanism called "Map" which helps her 
to  work on multiple table fields (each with different name) since the 
individual  table column name is not HardCoded inside the her. But she stores 
an alias (key)  that will point to the individual table column
 (value) containing similar  fields/data. 
  
 Which table field should be  contacted for retrieving data is dynamically 
resolved through the Mapping in the  Map from X++ itself. If a Map maps to 5 
different tables then we can say that  the mapping fields can be roughly the 
intersection of all the fields of the five  tables. 
  
 The story goes..............I opened  my eyes and pondered on what she told me.
  
 Regarding Maps  & Table "methods" ----
  
 Maps are used when u want to share  table methods to avoid duplication of code 
in each  table.
  
 In AX, tables have a similar  mechanism just like the class- "Global" in the 
system doc, for sharing resources  b/w objects. But for a table we expect that 
kind of "sharing" through the  concept of "Normalization". A good table design 
means the tables follow the 3rd  Normal form. But if you have tables that are  
going to contain same methods, due to the nasty reason that tables cannot be  
bought to 3rd Normal form for some good reason;  this will result in code 
duplication. We should not encourage this in AX. So  keep the methods that are 
going to duplicate, inside a mechanism called Map  (there are 2 Maps in Ax, 
Table Map and The MAP class both are different). Relate  the tables through the 
"mapping" section of the Table Map, put the methods which  are to be shared 
under the “methods” node of the Map.  
  
 NB: You have to use a map only when  Normalization is out of question.
  
 Thanks &  Regards
  
 Sailendran


trinadh sura <[EMAIL PROTECTED]> wrote:                                  When 
we write methods in maps?
 
 __________________________________________________________
 Ever tasted chocolate samosas? Try Sanjeev Kapoor's chocolate temptations 
 http://www.msnspecials.in/photogallery/photogallery.asp?id=a2006117124625628
 
 
     
                       

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]

Reply via email to