Changes between Version 8 and Version 9 of Grits_ProjectPreferenceStore


Ignore:
Timestamp:
03/08/2017 07:07:30 PM (5 years ago)
Author:
shan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Grits_ProjectPreferenceStore

    v8 v9  
    1 = Project Preference Store ( A Local Preference Store for Project)=
     1= Project Preference Store (Local Preference Store for Project)=
    22----
    33
    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.
     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.
    55
    6 Major Advantages:
    7 1. Currently the central '''GritsPreferenceStore''' does not store any preference value in maps and reads from file each time a preference value is read. This local preference store minimizes multiple read from file by keeping a cache of preference values in memory that have been read once.
     6__Major Advantages:__
     71. Currently the central ''GritsPreferenceStore'' does not store any preference value in maps and reads from file each time a preference value is read. This local preference store minimizes multiple read from file by keeping a cache of preference values in memory that have been read once.
    88
    9 2. 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.
     92. 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.
    1010
    11 These advantages are general for any similar local preference store in GRITS and are recommended for plugins that would be using preferences.
     11These advantages are general for any similar local preference store in GRITS. Plugins that would be using preferences are recommended to maintain a local preference store.
     12
     13== Implementation ==
     14''ProjectPreferenceStore'' works with enums and string. It takes enums as parameters and returns values in enums (single/multi-choice list).
     15
     16
     17=== Class Diagram for various Preferences in Project Preference store ===
     18[[BR]]
     19[[Image(project_preference_store.jpg, 800)]]
     20[[BR]]
     21
     22__Preferences in Project Preference store:__
     23
     24Currently there are four types of preferences for projects.
     25
     26- ''StringPreference'' - Simplest type of preference that has a '''string''' value. All other information related to it is available in the enum object.
     27
     28- ''Preference'' - Types of preference whose values are a '''list of string'''.
     29
     30- ''ParameterizedPreference'' - Types of preference whose values are a '''list of particular class object'''.
     31
     32- ''IntegerPreference'' - A special case of ''ParameterizedPreference'' whose values are a '''list of integers'''.
     33
     34By using the above enum objects as parameter, the need of knowing preference variable names 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 parameter then user can get a generic SingleChoicePreference or MultiChoicePreference (or its special case MultiChoiceInteger) enum object.
     35
     36A ''SingleChoicePreference'' is characterized by - a list of values and one default value.
     37
     38A ''MultiChoicePreference'' is characterized by - a list of selected values and a list of unselected values.
     39
     40A ''MultiChoiceInteger'' is a special case of MultiChoicePreference and is characterized by - a list of selected integers and a list of unselected integers.
     41
     42__Note:__ The simplest ''StringPreference'' is self-contained and has a single string value that can be directly accessed from the enum object.
     43
     44== Class Diagram for entire Project Preference store==
     45[[BR]]
     46[[Image(project_preference_all.png, 1300)]]
     47[[BR]]
    1248
    1349== Code Snippet ==
     
    5591}}}
    5692
    57 
    58 == Class Diagram for Project Preference Store ==
    59 [[BR]]
    60 [[Image(project_preference_store.jpg, 800)]]
    61 [[BR]]
    62 
    63 == Class Diagram for Project Preference Store as a whole==
    64 [[BR]]
    65 [[Image(project_preference_all.png, 1300)]]
    66 [[BR]]