December 5th, 2012, 05:30 AM
Design a Algorithm/ Module Design Pattern
I am having problem designing a module.Can anybody help me
This is basically an agricultural project (web application).I need to design module where some calcuation takes place.
There are differnt crops invovled like maize,tomato,okra etc.Now each of these crops have different traits.
Each trait has a mesurament scale which lies in integer like 200-1000.now let say i have planted the crop and
done measurement noted down the traits.Now i want to do some sort of measurement.Some measurements are simple and some are
Lets take an example of crop maize.I have recored observations for 15 trait.(trait1.. trait15 are just alias the acutal name can be like plt_ht,yld)
trait1 trait2 trait3 trait4 trait5 trait6..... trait15
i have recorded 5 observations for each traits
trait1 trait2 trait3 trait5 trait6..... trait15
01,02,03,04 01,02,03,04 01,02,03,04
User logs into system and selects his crops and enters data for these observation i either have to calculate average of those data entered for each or sum of those.
This is simple but complexity comes when for some of the tratis i have some different formulas. Like lets take an example let say a trait YLD has a formula based on which i have to caluate its value which may also depends on some other traits .This way all differnet crops have different traits.All this i am able to do whenever user selects crop i will check for those specific traits and do calculations if it is not special trait then i eaither avg it or sum it based on db entery but there is lot of hard coding .I want to have some suggestion from you people if u can think of an better way of handling this.
Click Here to Expand Forum to Full Width