Comments (4)
Further thoughts on this: get rid of SQL entirely. Simplify IConfiguration
by removing matrix, remove SourceSQL from ISubject
and rename SourceName on IField
to Key (we still want to look up fields based on a key that isn't the display name).
Now we can have concrete implementations like MatrixConfiguration
which uses the matrix SQL concept, RelationConfiguration
which uses RelationSubject
with the Dictionary<RelationSubject, FieldPath[]>
logic. We could possibly go as far as NHibernateConfiguration
which has ISubject
and IField
of Class
and Property
respectively.
If we still want SQL, we can have an ISqlSubject : ISubject
which defines the SourceSQL property. If we want to combine the IRelationSubject : ISubject
with the SQL behaviour, we can roll a RelationSqlSubject : ISqlSubject, IRelationSubject
.
From this point we now have options. The SqlGenerator
would move out of the core library as would ISqlSubject
etc. into something like dbqf.Sql
. The SqlGenerator
would work with the ISqlSubject
logic, so if you wanted to do querying via some other means you don't have to include this library. For the existing Standalone applications we'd make a factory (or something) that provided a way of getting results (keeping in mind this might not just be a DataTable - it might be real POCOs) by taking an IParameter. Then in our IoC bootstrapping we can swap behaviour as to how configurations are constructed and how results are retrieved!!
from dbqf.
A note on NHibernate. If we do the above logic we'd implement our own NH ParameterBuilder
s too. These would all return the same concrete NHParameter : IParameter
which has an ICriteria
property. The ParameterBuilder
s can then construct a whole ICriteria
graph by doing something like:
EqualsBuilder.Build(NHField f, object[] values)
{
return new CriteriaParameter()
{
Criteria = Criterion.Eq(f.Property, values)
};
}
Then we can use these with a query factory that uses NHibernate sessions (instead of the SqlGenerator logic), something like:
public DataSource GetResults(IParameter p)
{
// if you're an NH dev I give you my apologies for complete
// lack of knowledge in the API, but you get the gist
_session.Get<T>(((CriteriaParameter)p).Criteria);
}
from dbqf.
Initial refactor of SQL library committed to ee4102e
from dbqf.
dbqf.core only contains IConfiguration and dbqf.Sql contains IMatrixConfiguration. The Standalone application still relies on IMatrixConfiguration but this can be further broken down at another time. SqlString behaviour in criterion was also pulled out of core in the recent backend refactor. Until the other configuration types are implemented, this feature can be considered complete.
from dbqf.
Related Issues (20)
- Reconfigure Castle Windsor to initialise from configuration file HOT 1
- Advanced search exception when no UIElement
- Advanced search exception when searching with between value
- Refactor Solution HOT 2
- Add to NuGet HOT 1
- Add multi-field search textbox HOT 1
- Refactor backends HOT 2
- Gtk# Implementation
- Double click edit in advanced search
- Replace parameter in advanced search
- Loading a saved advanced search fails to reinstate the correct parser
- Rename standalone assembly name
- Database permissions crash standalone application
- delegate Func defined without namespace
- Implement user-definable outputs
- Implement advanced search HOT 2
- Create control for generating a FieldPath HOT 3
- Add date picker for DateTime fields
- Implement WPF application HOT 1
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 dbqf.