mardi 13 octobre 2015

beautiful code to solve the duty

Currently I trian a JavaScript project and till today having not much experience with design patterns. For data preparation for an external graphics library I need to gather some data from various sources and passthem in arrays and object. For this I have written to me a sequence of functions.

get_01_ajax_parameter()  { .... get_02_ajax_databasevalues(...); }
get_02_ajax_databasevalues() ....
get_03_ajax_jsonparameters()
get_04_ajax_3dmodel()
calculate_01_Xvalues()
calculate_02_Yvalues()
calculate_03_physicalAttributes()
calculate_04_color()
.....

I decided for this style because I need many lines for Ajax calls... How can I make this code more beautiful?

Aucun commentaire:

Enregistrer un commentaire