Castle Project ActiveRecord with XML - castle-activerecord

Can Castle ActiveRecord write to XML document? Any links to sample code?

Castle ActiveRecord is using NHibernate underneath. As far as I know, there is no XML-database driver for NHibernate.
So, answering your question - no, currently Castle ActiveRecord can't do this. If somebody writes a driver for XML file database - it could. Not a trivial task. I wonder if it is possible at all...

You might want to try this OLE DB Provider for XML, but I wouldn't count on it supporting all of NHibernate features and it will be limited in the schemas it can understand. Plus, you'd have to play a bit with dialect settings to see which one fits best.

Related

If I choose RavenDB, what benefits of SQL Server do I lose?

If I choose RavenDB for a fairly standard CMS-like web application, what do I lose compared to SQL Server?
EDIT: There is a word "benefits" in the title which is a little controversial term. Maybe I should have said something like "possibilities" or "features", hope it's clear what I'm after.
A few things that come to mind (but I'm new to RavenDB so this is just a few suggestions, some may be wrong, I hope someone would provide a more complete and accurate list):
Quick but customizable administrative interface using ASP.NET Dynamic Data (there is some built-in Silverlight admin application but I'm quite sure that it wouldn't replace a full-fledged admin section in my case)
Possibly some querying capabilities? Or can Raven indexes replace virtually every SQL query I might think of?
Entity Framework integration (I know some people hate EF but I think that being an EF provider means that you can easily publish the data as OData, use EF code-first etc., right?)
Azure deployment (not true according to comments)
Myriad of SQL querying / management tools
A more complete / accurate list would be greatly appreciated.
(Note: I'm not saying that I will need all (or any) of those, I'd just like to understand what's going to be unavailable if I choose RavenDB. Also, please don't discuss RavenDB strengths, I am aware of them and they are easily digestible from the official website.)
You may want to look # these 2 recent blog posts by Ayende (RavenDB creator) on when you should use RavenDB and when you shouldn't.
When should you use ravendb
When should you not use ravendb
Beyond the technology, you should consider your team members as RavenDB is an adjustment in thinking for those of us who have backgrounds in RDBMS. What type of stretch will this be for those involved? Will your users expect reports and what will the say when you tell them that you did not consider answering the questions that they want answered when you create the indexes for the document database? While you get a big boost in productivity when designing and implementing your domain, document databases are different than SQL.
Quick but customizable administrative interface using ASP.NET Dynamic
Data (there is some built-in Silverlight admin application but I'm
quite sure that it wouldn't replace a full-fledged admin section in my
case)
ASP.NET MVC supports scaffolding based on POCOs since second version. But it's not so quick'n'dirty solution.
Possibly some querying capabilities? Or can Raven indexes replace
virtually every SQL query I might think of?
You should to think about your queries first. Raven DB is not reporting database.
Entity Framework integration (I know some people hate EF but I think
that being an EF provider means that you can easily publish the data
as OData, use EF code-first etc., right?)
You are so focused on tools. Code First is the way how you work with document databases. Why you need OData? RavenDB has REST API out of the box.
WCF RIA Services (Silverlight).
You'll need to do all that WCF plumbing work.

Simplest way to develop an app that can use multiple types of databases?

I have a project for a class which requires that if a database is used, options exist for the user to pick a database to use which could be of a different type. So while I can use e.g. MySQL for development, in the final version of the project, the user must be able to choose a database (Oracle, MySQL, SQLite, etc.) upon installation. What's the easiest way to go about this, if there is an easy way?
The language used is up to me as long as it's supported by the department's Linux machines, so it could be Java, PHP, Perl, etc. I've been researching and found info on ODBC, JDBC, and SQLJ (such as this) but I'm quite new to databases so I'm having a hard time figuring out what would be best for my needs. It's also possible there may not be a simple enough way to do this; the professor admitted he's not a database guy either and he seemed to think it would be easy without having a clear idea of what it would take.
This is for a web app, but it ought to be fairly straight forward, using for example HTML and Javascript on the client side and Java with a MySQL database on the server side. No mention has been made of frameworks so I think they're too much. I have the option of using Tomcat or Apache if necessary but the overall idea is to keep things simple, and everything used should be able to be installed/changed/configured with just user level access. So something like having to recompile PHP to use ODBC would be out, I think.
Within these limitations, what would be the best way (if any) to be able to interact with an arbitrary database?
The issue I think you will have here is that SQL is not truely standard. What I mean is that vendors (Oracle, MySQL etc) have included types and features that are not SQL standard in order to "tie you in" to their DB, such as Oracle's VARCHAR2 and so on.
When I was at university, my final year project was to create an application that allowed users to create relational databases using JDBC with a Java front-end.
The use of JDBC was very simple but the issue was finding enough SQL features/types that all the vendors have in common. So they could switch between them without any issues. A way round this is to implement modules to deal with vendor specific issues and write ways to translate between them. So for example you may develop a database for MySQL with lots of MySQL specific code in that, but then you may want to use Oracle and then there are issues, which you would need to resolve.
I would spend some time looking at what core SQL standard all the vendors implement and then code for these features. But I think the technology you use wouldn't be the issue but rather the SQL you create.
Hope this helps, apologies if its not helpful!
Well, you can go two ways (in Java):
You can develop your own classes to work with different databases and load their drivers in JDBC. This way you will create a data access layer for yourself, which takes some time.
You can use Hibernate (or other ORMs). This way Hibernate will take care of things for you and you only have to know how to use Hibernate. Learning Hibernate may take some time, but when you get used to it, it can be very useful for your future projects.
If you want to stick Java there Hibernate (which wouldn't require a framework). Hibernate is fairly easy to use. You write HQL which gets translated to the SQL needed for the database you're using.
Maybe use an object relational mapper (ORM) or database abstraction layer (DAL). They are designed to provide a standard API to multiple database backends, making it possible to switch between different backends with minimal or no changes to your code. In Python, for example, a popular ORM is SQLAlchemy, and an excellent DAL is the web2py DAL (it's part of the web2py framework but can be used as a standalone DAL outside the framework as well). There are many other options in other languages as well.
use a framework with database abstraction layer and orm . try symfony or rails
There are a lot of Object relational database frameworks, unless you prefer jdbc. For simple/small applications this should work fine.

Delphi and NoSQL

Have anyone ever used Delphi with NoSQL databases like Mongo, CouchDB or others? Which one would you recommend?
For Mongo, theres TMongoWire and pebongo (early stages). For couchDB, I believe one would interact mainly through HTTP/JSON
For Cassandra, I believe the best bet would be to somehow incorporate a supported language inside your Delphi app and use that to interact with Cassandra, or else implement a web service in a supported language and make it accessible to your Delphi application.
Hope it helps.
There is a new full featured driver for MongoDB "mongo-delphi-driver" which can be found (with examples) here: https://github.com/gerald-lindsly/mongo-delphi-driver.
Delphi has few native NoSQL database solutions right-out-of-the-box:
BDE & Paradox & dBase through the TDatabase & TTable API;
TClientDataSet.
Not that I suggest them, but you have not listed your requirements.

What is A Domain Model class? How do you create one?

I have seen the ideas of domain models in UML, but I never got the chance to work with them in actual code. Now I see them in databases, particularly SQL coding, from this article
And there was a quote that mentions domain model classes:
I can design Domain Model classes
containing plain SQL as easily as I
can design classes that operate on the
database via an ORM layer. Keep in
mind that ActiveRecord is not a Domain
Model.
How do I create domain classes then? Does it differ when I'm in the "database context" when I'm in the "modeling context" or even the "programming context"?
A domain model has no notion of a database. It should be the logical representation of a problem domain. You've likely worked with domain models in every one of your projects to some degree.
To tie a domain model to a database, the Repository pattern makes for an excellent mediator.
Did you have a look at one of the Omondo UML examples which show how to use object approach and visualize your domain in an UML diagram ?
It seems to me that ORM modeling with UML is not a well established technology because only Omondo EclipseUML provides these ORM features ? The other UML tools can not generate Java annotation or reverse them. They generate code from a model but not ORM or JPA annotations because they directly generate a kind of database which is not for me an object approach. This is a non sense if UML tools generate database because database is not an object ? This is why the Omondo approach to generate ORM annotations and let the mapper do its job is what should be done. In my company we have created our model then let the database admin to add the UML stereotypes which are synchronized with the java annotation. finally we have passed all the project to the developer team. The code was very clean and easy to integrate later. It was a continuous integration from a model to the database using Eclipse and maven. It worked very well.
I have used UML and ORM in my last few projects. It is really very powerful !! I think that we will see more project in the future using ORM and UML modelling.

Best place to get started Qt Database Interface

I've been asked about using the Qt database interface for Oracle.
What's a good starting point for investigating this? Do you have any experience with it you can share?
We have been using the QtSql classes for a couple of years now, we are currently using the ODBC driver to connect to MSSql instance. Overall the the whole interface performs it's taks reasonably well. It insulates you completely from the Database driver QSqlDatabase, QSqlQuery and QSqlResult at the forefront, there are some abstractions that also insulate you from actual SQL QSqlTableModel and QSqlRelationalTableModel but those are geared for use in any of the Qt views. There is also a class QDataWidgetMapper that helps you map data to non table views. Also QVariant does an excelent job of wrapping SQL data, and providing typed access to the result of a query. While all of this is very helpful, unless your application is small in scope it won't save you from having to come up with a decent DAO layer, none of the Qt classes provide that.
We have a process where we turn a - custom made - xml description into a sql script for creating a table, a qt wrapper class for QSqlRecord and we use QSqlTableModel for most of our CRUD work. That work reasonably well but there is a lot of overhead in these classes so I would not repeat this approach.
We did find some quirks with the ODBC driver, I am sure there are some other quirks with the oracle driver. OTOH we are reasonably sure that we will be able to switch from MS-SQL to ORACLE within a short amount of time.
As for starting points, I think there is a simple example in the qt examples.

Resources