I'm not sure what I'm missing here, but I can't find a reliable ORM for AIR.
The ones I find are not documented well and don't seem to have a solid following. Is a solid ORM non-existant at this point?
Ones I'm aware of:
http://flexorm.riaforge.org/
http://code.google.com/p/airorm/
http://code.google.com/p/air-activerecord/
I Never used it but have a look at the Cairngorm Persistance Library :
http://sourceforge.net/adobe/cairngorm/wiki/HowtoUsetheCairngormPersistenceLibrary/
Looks like what you're looking for :
"The Persistence library eases the communication between an Adobe AIR application and an SQLite database. Both use different type systems (relational SQL versus object-oriented ActionScript). This Object Relational Mapping (ORM) library follows an iBATIS approach."
Check out Flextrine at www.flextrine.com
This is a client/server Flex ORM solution that integrates with Doctrine 2.
ORM frameworks are designed to help access a database. Since Flex has no direct access to a database, an ORM framework would be extremely limited.
I assume the projects you link to are for dealing with AIR and the embedded SQLLite database.
There are plugins for Flash Builder that will generate value objects based on the database you specify. Originally they were just for ColdFusion, but I think they've expanded to include other technologies. However, I would not consider these "code generators" the same as an ORM.
Check out FxORM. It has nice documentation with examples if you follow the link.
Related
I have read some articles about automatic code generation of ADO.Net data access layers in .Net applications. There are some tools available like CodeSmith or LLBLGen Pro. Does anyone has experience with these tools? Is it better to use these tools rather than using LINQ? Thanks.
Better is subjective - however, I understand what you're really trying to ask. Essentially, my answer to the question of which tool is right (best) for the job is: it depends on the job. Linq -> SQL is older tech of which M$ has no plans of updating or improving. I would stay away from it... if you want similar functionality Entity Framework or another ORM is best.
NoSQL is huge right now and offers a big boost in productivity due to no database development or mapping or ORM layer to muck with. Just create your entities and store them! My recommendations on those are:
RavenDB
CouchBase
MongoDB
Riak
Redis
Cassandra
There are also graph databases useful for 'networks' of 'things' that are related in some fashion or another.... the two that I've used are below:
Neo4j (popular, java based, has .net client)
Sones (.net based - newer kid on the block)
As for SQL databases - well, some companies don't want to endure a paradigm shift or have requirements that stipulate only x database will be used in the company, etc... In those cases you have to work with whatever you have to work with. ORMs can aid in this arena... Some popular ORMs are listed below:
Entity Framework (M$)
NHibernate (very popular)
Subsonic (older but still used)
Dapper
Massive
PetaPOCO
And as for regular ado.net and to address your main question - there are not a lot of frameworks that generate the data layer for plain ado.net, etc... but I did find these and it turns out to be very useful in my projects:
http://www.elencysolutions.co.uk/ (not open source)
http://spgen.codeplex.com/ (open source & customizable)
http://www.nettiers.com/ (open source but sorta old-erish)
I've been trying to figure out how to get a decent LINQ to something working for ORM database access in a Windows Store app.
All I've found is SQLite and the sqlite-net NuGet package. The latter sucks a bit, as I don't get any .dbml like structure which resolves relationships and provides navigation properties for easy querying (no manual joins needed then).
I was wondering:
Does dblinq in comnbination with SQLite offer this?
Will using this pass Windows Store validation?
Thank you !
Update: Some links I used in my research:
The famous Tim Heuer post on SQLite and Windows 8: http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
DBlinq: http://code.google.com/p/dblinq2007/
sqlite-net: http://code.google.com/p/sqlite-net/
Interesting discussion stating ADO.NET is not possible: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e9cdd75d-03e4-4577-988e-4c02a52e3f50
I'm not familiar with dblinq but by looking at the sqlite tests in the project, it seems the library is offering what you're looking for, i.e. navigation properties for relationships between different tables.
Since dblinq is a .NET library, using it shouldn't make the store validation fail. There is another problem though: you can't use such a .NET library in a Windows Store application, only Windows Store class libraries and portable class libraries are allowed. Since the source for the library is available, you can try compiling it as a Windows Store class library, but I'm afraid there are going to be some classes missing that dblinq is depending on which might make it difficult to port.
I am using (Code First) Entity Framework 4.3 for an ASP.NET MVC project, and wanted to implement granular Permission based authorization features as provided by Rhino Security
Though it is the only such Permission based Lib available, but it's not yet been ported to EF. What can be the reason,
Such a Permission Framework is not a usual requirement in projects, so it's not so famous
Entity Framework is not so effective and so is not as ubiquitous as NHibernate
Rhino Repository is so tightly coupled with NHibernate that it's not possible to simply port it to EF
Most Important, If i really insist on using it with EF, and if you tell me it's not possible, can you please help me understand why. And if your answer is in YES, can you please help me with HOW TO DO IT
ANY OTHER IDEAS please
If I really get started implementing it using EF, would it be a futile endeavor. Any complications i would face.
As I am just a newbie both with Entity Framework and MVC, is there anything I am overlooking. So, please help me all GENIUSES out there.
Any ideas how to get started?
My opinion:
It cannot be ported directly. Rhino-Security follows concept of separating (abstracting) security from your domain model. This separation is done through IUser interface. Implementing IUser interface in your User class will be the only connection between your domain model and the security infrastructure provided by the framework. Here comes the problem. EF doesn't currently support interfaces so you cannot use an interface instead of a real entity type in the mapping and you cannot have an interface instead of a real entity type as a navigation property in your entities. Because of that Rhino-Security cannot be ported to EF without crippling its main idea - you will have to create User entity directly in ported security library and all applications will have to be dependent on that User implementation.
I'd say the third answer:
Rhino Repository is so tightly coupled with NHibernate that it's not
possible to simply port it to EF
I'm not sure about what's the reason behind that, but I'm sure it's closely bounded to NHibernate (or to Castle Active Record, that is based on NHibernate)
I have ASP.NET project and I want to know what is better to use.
ODBC connection and with Server Explorer (drag and drop make DataSet and modify it) or do some DBconnect class with connection to database, queries and use it for GridView?
When I use server explorer, I don't have good feeling because all logic is on aspx page and I do not separate from the application layer logic layer.
It will be a lagre application, databese(PostreSQL) have 18 tables and difficult constraints and application have to generate some documents etc. .
"Better" depends entirely on your situation. Is the purpose to get something done as quickly as possible for internal users at your company, or is this going to be a commercial site that will need to be highly extensible and needs to be as easy as possible to maintain? Will you need to integrate with other platforms possibly built using other languages at some point? The answers to all of these questions should affect your decision.
If you're looking to separate your project into distinct layers, then I would recommend an ORM such as NHibernate or Entity Framework (there are other commercially available ORM products out there, but these are the ones I'm familiar with and which you can easily get help with on this site).
Create a DataSource with LINQ to Entity. It let you the liberty of LINQ with the peace of mind of when you change something il will break your build so you will be able to debug more efficiently.
Well if you have total flexibility, I would recommend using C# ASP.NET 4 with MVC3 razor for the UI and application code. Use Entity Framework 4.1 code first for the data access layer.
This way you will always work with real objects that you create, and with List<realtype> instead of the total mess that exists with datasets.
I am still very new to Actionscript and have an okay working knowledge of Flex. I am working on an AIR application that runs a SQLite database underneath. The database is only 3 tables (projects, items and types). I was wondering if Actionscript best practices are to use a data access object or layer to store all of my database functions or to just run them inline as needed. I would assume an access layer would be best for interacting with the database for usability, but I can't seem to find much documentation for SQLite in AIR.
It depends a bit on the complexity of your application, but in general I would propose using an abstraction over the database access. The key is to create an interface that your application will talk to and then provide a SQLite implementation. The benefit is that you can easily create a stub or mock implementation for testing and you can create new implementation that talk to other technologies. The Spring ActionScript framework has some good utilities to achieve this.
I responded to a similar question here.