-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with unique references singleton implementation #1791
Labels
bug
Something isn't working
Design
Task relating to project design
enhancement
New feature or request
Optimisation
Code optimisation required
Comments
6 tasks
abuts
added a commit
that referenced
this issue
Dec 29, 2024
abuts
added a commit
that referenced
this issue
Dec 29, 2024
abuts
added a commit
that referenced
this issue
Dec 30, 2024
abuts
added a commit
that referenced
this issue
Dec 30, 2024
abuts
added a commit
that referenced
this issue
Dec 30, 2024
abuts
added a commit
that referenced
this issue
Dec 31, 2024
abuts
added a commit
that referenced
this issue
Jan 1, 2025
abuts
added a commit
that referenced
this issue
Jan 1, 2025
abuts
added a commit
that referenced
this issue
Jan 1, 2025
…tainer.m May be returned later as convenience methods with unit tests added. fixed bunch of tests and removed some warnings.
abuts
added a commit
that referenced
this issue
Jan 2, 2025
abuts
added a commit
that referenced
this issue
Jan 2, 2025
…ent from container type, throw errors as warning may cause strange unexpected results. renamed test test_unique_objects_container to test_objects_containers
abuts
added a commit
that referenced
this issue
Jan 5, 2025
abuts
added a commit
that referenced
this issue
Jan 5, 2025
abuts
added a commit
that referenced
this issue
Jan 5, 2025
abuts
added a commit
that referenced
this issue
Jan 5, 2025
abuts
added a commit
that referenced
this issue
Jan 5, 2025
abuts
added a commit
that referenced
this issue
Jan 5, 2025
…iner and removed redundant and duplicated methods
abuts
added a commit
that referenced
this issue
Jan 9, 2025
abuts
added a commit
that referenced
this issue
Jan 9, 2025
cmarooney-stfc
added a commit
that referenced
this issue
Jan 10, 2025
* fix fetch of glc * Re #1791 Alternative solution, unit tests * Re #1791 one more test to prove unique storage operations * extend commenting of tests --------- Co-authored-by: abuts <[email protected]>
abuts
added a commit
that referenced
this issue
Jan 20, 2025
abuts
added a commit
that referenced
this issue
Jan 20, 2025
abuts
added a commit
that referenced
this issue
Jan 20, 2025
abuts
added a commit
that referenced
this issue
Jan 20, 2025
abuts
added a commit
that referenced
this issue
Jan 20, 2025
# Conflicts: # _test/test_multifit/test_multifit_horace_1.m # _test/test_unique_objects_container/test_unique_references.m # herbert_core/utilities/classes/@unique_objects_container/unique_objects_container.m # herbert_core/utilities/classes/@unique_references_container/unique_references_container.m # horace_core/sqw/@Experiment/private/build_from_binfile_headers_.m # horace_core/sqw/@sqw/sqw.m # horace_core/sqw/file_io/@faccess_sqw_v4/get_sqw.m # horace_core/sqw/file_io/@sqw_binfile_common/get_sqw.m
abuts
added a commit
that referenced
this issue
Jan 23, 2025
abuts
added a commit
that referenced
this issue
Jan 23, 2025
abuts
added a commit
that referenced
this issue
Jan 23, 2025
abuts
added a commit
that referenced
this issue
Jan 23, 2025
abuts
added a commit
that referenced
this issue
Jan 23, 2025
abuts
added a commit
that referenced
this issue
Jan 24, 2025
Addressed by Re #1800 |
abuts
added a commit
that referenced
this issue
Jan 24, 2025
Fixed by Re #1800 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
Design
Task relating to project design
enhancement
New feature or request
Optimisation
Code optimisation required
ISSUE DESCRIPTION
This ticket addresses two issues: Design flaw and bug. Bug can be actually sorted differently, but still mentioned here.
Simple demonstration illustrates this:
list
option of the container to be able to explore its contents, namely, add return value:glc = glcontainer
; to row 862 of theglobal_references_container
code base to be able to explore its contents.clear classes
,clear all
)_test\test_miltifit\test_multifit_horace_1
and set up break point at row 32, immediatly after Horace loads reference cuts.There are 3 reference cuts in this reference file, each contains 8 runs with all detector files for each run are the same.
BUG:
unique_reference_container
does not count and eliminate unique runs desipite they are equal according to existing cmparison rules. It just adds them together and puts them all in memory.Due to design flaws described below, this bug should not be fixed on the basis of this very customized singleton implementation. Standard singleton implementation should be implemented and properly deployed in Horace.
DESIGN FLAW DESCRIPTION:
Singleton is a standard pattern in software engeneering. Search "Singleton in Matlab" returns bunch of references, e.g.:
etc.
They are all rerfer to a bit different implementations which have the same main features:
instance
method which provides access to internal storage and methods which interact with this storage.Using standard code patterns higly improves readability, maintainability and stability of code.
Horace has couple of places where singleton is already used according to the pattern above (e.g.
config_store
andsqw_formats
factory)unique_references_container
contains different implementation of singleton, designed as static variable stored withinunique_references_container
This implementation has number of disadvantages:
unique_references_contanter
are mixed together, despite having different purposes.The work of converting this custom design into standard singleton implementation is not too difficult and should be performed before doing any modifications to unique references container. I would say that this work is prerequest for doing Re #1781, part 3.
The text was updated successfully, but these errors were encountered: