vb.net - Updating Classes and function -


assume have class called "myclass"

public class myclass  end class 

this class has function called "my function"

public class myclass     public function myfunction()      end function end class 

this class has been implemented time , been working fine. need change implementation of function "myfunction". 1 option open source code , change there. i'm guessing there has better approach.

inheritance comes mind don't want change derived classes name. want name of class still remain "myclass", i'm guessing code below cause error:

public class myclass     inherits myclass     public function myfunction()      end function end class 

in other words i'm trying create new version of old class keeping of members same changing few functions.

to explain project whole, program meant structural design. designs structural components (i.e columns, beams, slabs, ...). design procedures specified 3rd parties (government regulations). example: in year 2007 government regulations specified column dimensions satisfy equation f:

h*b < fy^2/l 

in year 2008 introduced new function g , column dimensions must satisfy new function:

h*b^2 < fy^0.5/e+alpha^2/l 

where h , b column dimensions.

what don't want open source code every year , make these changes. want somehow override functions need changed without opening source.

any ideas?

the code not supposed changed on time. - if wrote code guaranteed break after 2 weeks itself, should reconsider design.

as rules/regulations come out, update input data (in form of xml, or relational database large amounts of data), , program automatically pick up.

the case update program under scenario when new type of regulations come out. in case changes minimal.

a anti-pattern example - have 500 forms, each of them has 500 lines of code, that's 250000 lines of code in ui layer. new regulations come out requires changing 50% of code in each form. impact 125000, @ 40 lines of code per day take 8.5 developer-years.

a solution having change of 100 lines spread across forms, adding 1 line in each, or leaving is. there data load/conversion procedure government/other file, populates database in proper format, updating values or adding new ones. there may 10 lines of change in program, that's it, 3 days worth of work, if believe in 40 loc per day. otherwise still falls under 2 weeks of developer's time.

depending on how implement it, benefit of approach support old standards well, older input can matched , production reports can generated. practice able back-date reports, cause there issues in report code left unnoticed months before being discovered.

edit: more structured approach suggested in comments storing expression trees in db. simple form of linear workflow, using postfix notation (single table). example a, b, + c - equivalent a + b - c. can have user interface configuration tool, allows user input values , functions applicable. assuming applicable values stored in db parameters (one structural component can have 0...n of them).


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -