The best way to implement a class library that contains standards that change annually

I want to create a class library for some standards. These standards are updated annually (not necessarily every year, it may take 3-4 years). I also want to support older versions. What is the best way to do this?

I am currently thinking of the following structure:

StandardName (namespace) --> Year(namespace) --> actual implementation of particular standards Class

the problem is that changing the standard from one year to another will also require copying the entire class into a new namespace, although some of them may not change at all. Is there an effective way? Or am I running out of time?

+3
source share
6 answers

, .

, .

, , , , , . , , , , ... ( , ).

... , , . , , , , . , .

+1

OO . - , . , .

, - (.. ), .

. , , . .

+1

:

  • ?
  • ?

, .

, , .

, , . , , , , .

: , , .

+1

, "" . , . factory, , , / . , . , .

, , , OO, .

0

, , , - .

Qt4 QtSupport Qt3- . . , , .

0

, , , .. (, .)

, DateTime Applied, , :

SELECT TOP 1 Value WHERE Key = %A AND Applied <= GETDATE() ORDER BY Applied DESC

The advantages of this solution are that if you know some changes that will be applied in a certain period of time (for example, several months), you can simply add the corresponding database records and the changes will be applied when it is correct. The disadvantages are that it is difficult to save anything else besides the values, and you need to create the appropriate caching so that it does not fall into your database for every access, but will update it when a new value is applied.

0
source

Source: https://habr.com/ru/post/1726241/


All Articles