Changes between Version 10 and Version 11 of Grits_ProjectPreferenceStore


Ignore:
Timestamp:
03/09/2017 05:13:02 PM (5 years ago)
Author:
shan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Grits_ProjectPreferenceStore

    v10 v11  
    1 = Project Preference Store (Local Preference Store for Project)=
    2 ----
     1= Project Preference Store =
    32
    4 ''ProjectPreferenceStore'' is a local store for storing preference values related to project, e.g. preference for project's Task information. This local store caches the preference values in maps (map key is the id of the preference variable). It calls ''GritsPreferenceStore'' only if the value is not found in its map.
     3''ProjectPreferenceStore'' is a '''local preference store''' for storing preference values related to project, e.g. preference for project's Task information. This local store caches the preference values in maps (map key is the id of the preference variable). It calls ''GritsPreferenceStore'' only if the value is not found in its map.
    54
    65__Major Advantages:__
     
    982. Currently preference values are stored as string in the preference file. Each time  a preference is read, a generic ''PreferenceEntity'' object is created by ''GritsPreference'' store. This ''PreferenceEntity'' object is later converted to more specific preference object for getting preference values. ''ProjectPreferenceStore'' reduces multiple unnecessary de-serialization of preference values from strings stored in file. [[BR]]For example, if there were four tasks, ''ProjectPreferenceStore'' would cache a list of four tasks (along with its default information) which would be otherwise each time read as string from file, unmarshalled to PreferenceEntity object and then converted to list of tasks.
    109
    11 These advantages are general for any similar local preference store in GRITS. Plugins that would use preferences are recommended to maintain a local preference store.
     10These advantages are general for any similar cached-local preference store in GRITS. Plugins that would use preferences are recommended to maintain a local preference store.
    1211
    1312== Implementation ==
     
    1716=== Preferences in Project Preference store ===
    1817[[BR]]
    19 [[Image(project_preference_store.jpg, 800)]]
     18[[Image(project_preference_store.jpg, 700)]][[BR]]
    2019Class diagram for project preferences
    2120[[BR]]
    2221
    23 __Preferences in Project Preference store:__
    2422
    25 Currently there are four types of preferences for projects.
     23Currently there are four types of preferences for projects. Each of these preference is an enum object and has all the information needed to get a preference value.
    2624
    27 - ''StringPreference'' - Simplest type of preference that has a '''string''' value. All other information related to it is available in the enum object.
     25- ''StringPreference'' - Simplest type of preference that has a '''string''' value. All information related to it is available in the enum object
    2826
    29 - ''Preference'' - Types of preference whose values are a '''list of string'''.
     27- ''Preference'' - Types of preference whose values are a '''list of string'''
    3028
    31 - ''ParameterizedPreference'' - Types of preference whose values are a '''list of particular class object'''.
     29- ''ParameterizedPreference'' - Types of preference whose values are a '''list of objects of a particular class'''
    3230
    33 - ''IntegerPreference'' - A special case of ''ParameterizedPreference'' whose values are a '''list of integer'''.
     31- ''IntegerPreference'' - A special case of ''ParameterizedPreference'' whose values are a '''list of integer'''
    3432
    35 By using the above enum objects as parameter, the need of knowing the preference variable name or the need of knowing filename for default values (when a preference is not found in the preference file) is removed. When one of the above enum is passed as a parameter then user can get a generic SingleChoicePreference or MultiChoicePreference (or its special case MultiChoiceInteger) enum object.
     33By using the above enum objects as parameter, the need of knowing the preference variable name or the need of knowing filename for default values (when a preference is not found in the preference file) is removed. When one of the above enum is passed as a parameter then user can get a generic ''SingleChoicePreference'' or ''MultiChoicePreference'' (or its special case ''MultiChoiceInteger'') enum object.
    3634
    37 A ''SingleChoicePreference'' is characterized by - a list of values and one default value (currently it only supports string values)
     35- ''SingleChoicePreference''
     36 - characterized by a list of values and one default value (currently it only supports string values)
    3837
    39 A ''MultiChoicePreference'' is characterized by - a list of selected values and a list of unselected values.
     38- ''MultiChoicePreference''
     39 - characterized by a list of selected values and a list of unselected values
    4040
    41 A ''MultiChoiceInteger'' is a special case of MultiChoicePreference and is characterized by - a list of selected integers and a list of unselected integers.
     41- ''MultiChoiceInteger''
     42 - characterized by a list of selected integers and a list of unselected integers
     43 - a special case of MultiChoicePreference
    4244
    43 __Note:__ The simplest ''StringPreference'' is self-contained and has a single string value that can be directly accessed from the enum object.
    44 
    45 == Class Diagram for entire Project Preference store==
     45__Note:__ The simplest ''StringPreference'' is self-contained. It has a single string value that can be directly accessed from the enum object.
     46== Project Preference store==
    4647[[BR]]
    47 [[Image(project_preference_all.png, 1300)]]
     48[[Image(project_preference_all.png, 1000)]][[BR]]
    4849Class diagram for project preference store
    4950[[BR]]
     51
     52
     53== Preference and their values ==
     54Currently it happens to be the case that certain preference types have certain preference values. Here is the mapping of current preference type and their values:
     55
     56||= Preference type       =||= Preference values     =||
     57|| StringPreference        ||    -                    ||
     58|| Preference              || SingleChoicePreference  ||
     59|| ParameterizedPreference || MultiChoicePreference   ||
     60|| IntegerPreference       || MultiChoiceInteger      ||
     61
     62
     63__Note:__ Currently ''SingleChoicePreference'' is not generic and only supports string preference values. If later some ''ParameterizedPreference'' have ''SingleChoicePreference'' values then ''SingleChoicePreference'' should be made a generic class.
    5064
    5165== Code Snippet ==