Comments (3)
The Data layer is the furthest along in terms of OOP, but it still needs a lot of attention. It's not using interfaces to define modeled data, is tightly coupled to MySQL, and hasn't yet been converted to use PHP's PDO interface, which will eventually be the only option.
Also, DatabaseObject is highly specialized in how it generates its models from a DB table's fields and join relationships, and isn't well documented. It seems most developers tend to just write queries directly in methods to access the data they need, regardless of whether there's a model for it. I've been guilty of it myself when there seems to be no other option.
Methods are overrun with configuration conditionals. The Resource class has to repeatedly ask if the license or organization modules are installed to figure out which query and fields it should be using to get the right data.
That's why we need a Repository model, so, for example, the Resource class and any other class that needs to can ask the singular LicenseRepo to getLicensesByResourceId(). The configuration decisions about what database the licenses live in, or if it's in a database at all, are made once and only by the Factory that provides the LicenseRepo to code that ask for it. And just as importantly, calling classes will no longer be querying the DB directly for data that another class is responsible for modeling.
That being said, I don't think any of that has to be implemented before we start on implementing an MVC pattern, because as you said, the data is technically already accessed by the controllers through classes (with a few exceptions). Most of the change over to MVC would impact the controllers and view rendering.
from coral.
I feel like it has come up before in terms of better separation of the data layer, but I can't point to anything specific.
from coral.
It seems we almost/already have a model as most of the DB access are abstracted by the DBService class and business classes like Resource, License, Organization that look like data access objects.
What else is needed?
The other big challenge is to separate the business logic from the views. What general things needs to be defined here we can continue working on #78 ?
from coral.
Related Issues (20)
- Unable to delete an "Authentication Type" from the list in Admin in the Resources Module.
- Unable to add a "category" to the module "Management" in CORAL version 2020.09 HOT 1
- How do I enable the Dashboard on the Resources Module? HOT 2
- Does SUSHI connect on Localhost/Local IP? HOT 1
- Emails are not receiving HOT 2
- Next Run Date on SUSHI Services HOT 4
- Problem in Usage Statistics Module HOT 3
- SSL Certificate Issue in Usage SUSHI test on Ubuntu
- Permit issues for resource contacts
- Feature Request: Placing import buttons at the top of the Usage Statistics file review screen HOT 4
- Feature request: Edit order acquisition type prompts workflow restart
- Deleted a step from a workflow for a resource, entire tabs now blank
- File Import option in Resource module in CORAL 2020.09 version not working properly
- Text not saving in fields
- Add A higher resolution FaviCon for use in shortcuts/bookmarks HOT 1
- Security contact
- SUSHI Registry Link Invalid HOT 1
- Error with datepicker for at least one month HOT 4
- Undisclosed File Size Limitation for Resource Attachments HOT 1
- Mysql Version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coral.