-
Notifications
You must be signed in to change notification settings - Fork 333
#3249 Refactor DAO layer for modular architecture #3252
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
Open
Patrykb0802
wants to merge
8
commits into
release/2.8.1
Choose a base branch
from
feature/#3249_Refactor_DAO_layer_for_modular_architecture
base: release/2.8.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d308d8f
#3249 Refactor DAO layer for modular architecture
Patrykb0802 b2ffeb2
#3249 Refactor DAO layer for modular architecture
Patrykb0802 6b3e823
#3249 Refactor DAO layer for modular architecture
Patrykb0802 b305502
#3249 Refactor DAO layer for modular architecture
Patrykb0802 5bc0703
Merge remote-tracking branch 'origin/release/2.8.1' into feature/#324…
Patrykb0802 e666e40
#3249 Refactor DAO layer for modular architecture
Patrykb0802 11f7a5b
#3249 Refactor DAO layer for modular architecture
Limraj 678ee67
#3249 Refactor DAO layer for modular architecture
Patrykb0802 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using this class, the logic for getting the prefix etc. can be included, for example, in the ApplicationBeans class.
instead:
we only use:
<bean id="dataPointUserDAO-mysql" class="org.scada_lts.dao.DataPointUserDAO"/>then in ApplicationBeans:
edit: Okay, that's not enough, you would also need to load this context, just like other contexts, and include it in the contexts from ApplicationBeans, without any complicated logic.
Patch with corrections to your approach:
modular_refactor.patch
For this to work, you need to add the bean to the XML context with a specific database:
<bean id="getDatabaseBeans" class="org.scada_lts.web.beans.GetDatabaseBeans"/>But i am suggest:
<bean id="dataPointUserDAO" class="${scadalts.database.dao.dataPointUserDao}" />and in env.properties add:
scadalts.database.dao.dataPointUserDao=org.scada_lts.dao.DataPointUserDAOWe avoid complex logic, manual synchronization, loading additional contexts etc., spring takes care of everything, and to add a new library, just include the lib and indicate the path to the dao in env.properties and that's it.