ASP.NET MVC with Postgres; ORM recommendations? - asp.net-mvc

I'm project managing an intranet application being developed at work. We're in the early planning stages. I've previously done all my development in Python using Django, but as we're a windows shop we're probably going to go with ASP.NET MVC.
We won't really be able to afford a SQLServer license though, so we were perhaps looking into using Postgresql. However I can't seem to find many examples or guides for people who want to utilise a third party ORM - or at least, an ORM with similar usage as Django - that works with Postgresql.
Ultimately we'd like to handle authentication via Active Directory [including groups], but store actual content within the db.
There have been previous questions of a similar nature, but most of them are over a year old when MVC was stil in Beta.
Any ideas?

NHibernate by a country mile.
It also supports MySql and should you want to change it has the main commmercial ones too. Haven't switched between db vendors but if you don't do much bespoke t-sql and say use fluent nhibernate you could almost plug and play between database platforms.
The support and community behind NHibernate when it comes to Mvc is second to none. It is categorically the ORM of choice.

You can try DataObjects.Net - open source ORM with GPLv3 or commercial licenses. It also supports Postrges.

NHibernate supports PostgreSQL. See http://vampirebasic.blogspot.com/2009/02/nhibernate-with-postgresql.html for some advice on how to integrate the two.
Also worth mentioning is that NHibernate now supports LINQ syntax. See http://ayende.com/Blog/archive/2009/07/26/nhibernate-linq-1.0-released.aspx for more details.

I'd recommend Mindscape LightSpeed. It supports PostgreSQL and has a visual designer baked into Visual Studio with full database round tripping to PostgreSQL.
When there was no add-in for Visual Studio to support PostgreSQL from the Server Explorer the guys wrote a free visual studio add-in for supporting it.
Solid O/R Mapper with LINQ mixed with first class visual model development against PostgreSQL. It is a commercial product however there is a free edition for small databases.
Mindscape LightSpeed O/R Mapper

Try Devart LinqConnect - http://www.devart.com/linqconnect/. This Framework supports PostgreSQL, Oracle, MySQL, SQLIte.

Unfortunately, most answers you get on a question like this are going to be based on the responder's opinion and experience and not based on yours.
Most of the suggestions here are good... however... if you are looking for a lightweight/fast ORM that is similar to Django, JackD has the right solution (LinqConnect)...
I've used most of the solutions listed including Django, and find that I usually pick LinqConnect if I'm looking for fast, lightweight and easy. For heavier (read larger) projects I would use something more robust like NHibernate.
But to answer your question correctly... the closest match and least learning curve for someone using Django would definitely be LinqConnect.

Related

Best OLAP option for ASP.NET MVC and Oracle 11g

We're working on a ASP.NET MVC 4 project with Oracle DB (11g). Customer has asked us to add ad-hoc reports (OLAP) to our system, so we're looking at possible options. User interface should be integrated into existing ASP.NET MVC web-site and data source should be Oracle DB. What is the best available options for such configuration?
I guess this is rather late (being well over a year after the post!) but I would strongly recommend the OLAP option that is embedded into the 11g database.
Oracle have wrapped it in all sorts of crud and provided some not very good client tools (e.g. the OLAP worksheet) but the underlying engine, based on a tool originally called Express, has an extremely good pedigree and remains one of the best on the market. Performance is great, it has an excellent and fully-featured language and costs a fraction of Oracle's own Hyperion offering.
Best of all, it is embedded in the Oracle database allowing (relatively) easy transfer of data from one to the other (although they are still surprisingly much at arm's length, given how long the technology has been owned by Oracle).
Having had relatively limited success with the client tools provided by Oracle, we have tended to go back to basics and define/populate objects manually in the OLAP cube - although most of our applications tend to involve modelling/forecasting so require write-back, which is a strength of Oracle OLAP, but not well supported by the client tools as Oracle would rather you used the more expensive Hyperion.

mono or RoR for new application run on linux?

I have little experience with ruby itself. I am going to hire somebody to write a web based application and I wanted it to be written in RoR but I was recommend mono. I guess because they like mono and because they think the RoR is slow.
The whole application would be some kind of social media meta management tool. There will be front end web based part and then back end doing the 'real stuff'.
I have no experience with mono at all and I am not experienced enough to comfortably say that RoR is the best choice.
I understood that if RoR is configured properly it could be pretty fast. I read that RoR has some troubles with scalability. I will start the application small and if it's successful I need to scale it up.
What would you recommend?
in the light of
performance
scalability
easiness to test
easiness to maintain, develop code/project
( I like ruby but I am not going to be the developer myself. I prefer to choose the 'better' option if there is such answer to that question)
please feel free to suggest anything else ...
If you are not going to write it yourself, you may want to go with what the person who will write it is most comfortable with.
Full disclosure: I have developed several sites now using Mono and I love it. I have used Ruby-on-Rails but not for anything nearly as big as what I have done in Mono. Keep that in mind.
Quick answer: In the greater scheme of things, Ruby-on-Rails and ASP.NET MVC have more in common than not. My choice would be ASP.NET MVC on Mono but I doubt you would regret choosing either.
Architecture: If you want one way of doing it out of the box, choose Ruby-on-Rails. If you want to be able to choose what you feel are the best-of-the-best technologies from a range of choices, choose .NET (Mono).
Ruby-on-Rails is more of a turn-key solution in that it provides a standard way of doing pretty much everything you need out of the box. .NET (Mono) offers a lot more power (my opinion let's say) but there are a lot of different pieces to choose from and you have to choose a technology stack yourself. As an example, RoR has a standard way of accessing databases while .NET Mono let/force you to choose from a dozen different ways to do that.
Mono and .NET generally have a little better separation of concerns so the purist in you might like that. If not, you actually find the roll-up-your sleeves and get it done attitude of Ruby more to your liking.
Performance and Scalability: This should clearly go to .NET and Mono. In fact, I believe the fastest way to run Ruby-on-Rails is to use IronRuby to run it on .NET. StackOverflow is written in ASP.NET MVC and, given the amount of traffic, it obviously performs great. Proof is in the pudding. That said, the performance bottleneck will probably not be your choice of framework.
Testing: Old style ASP.NET (now called WebForms) is considered pretty hard to test. The newer ASP.NET MVC was designed to be easy to test and is similar to RoR. One major factor is that in Mono you will probably be using a statically typed language (like C#) while Ruby is of course a dynamically typed language. You have to write more tests in a dynamic language (because the compiler/interpreter will not catch type problems) but it can also be easier to write tests if you are not fighting the compiler. I think it is a matter of taste and style (I like static) but this is a major factor in answering this question.
Of course, since .NET/Mono is a multi-language platform, you could always write your ASP.NET MVC tests in a dynamic language. You could even do it in Ruby (IronRuby). Perhaps that would be the best of both worlds (static checking on your real code and flexible dynamism in your tests). I have considered doing this myself using IronPython for tests.
Maintenance and development: This is a tough one. It depends what you are writing, what third-party libraries you might need, and what tools you are going to use. I would say that RoR is probably the more advanced MVC framework. My own thoughts are that Ruby-on-Rails is probably a shade easier to write but a little bit harder to maintain.
Community: I like the Ruby community more than the .NET one but I think I like the Mono one the best. That makes it a little confusing. The core Mono guys (like Michael Hutchinson that answered here) are simply awesome. I really like MonoDevelop as a tool (IDE) as well. It just keeps getting better and better. Michael, thank you for Git support if you had anything to do with that. :-)
Tools: If you are writing for Mono you can use the whole universe of .NET tools (VisualStudio, ReSharper, Reflector, etc) so that is pretty hard to beat. That is assuming you develop on Windows of course. On Linux or Mac the tool of choice for Mono would be MonoDevelop. It supports version control, a software debugger, and NUnit tests right in the IDE and is completely cross-platform.
It seems like a lot of Ruby folks just use a simple text editor. This may just be because an IDE just does not have as much to offer a dynamic language as it does a static one. Here is a SO question on what people like for Ruby:
What Ruby IDE do you prefer?
EDIT: Just to make things confusing...there is another MVC framework for .NET/Mono that is even more like Ruby-on-Rails; MonoRail even has an implementation of ActiveRecord. MonoRail has actually been around longer than ASP.NET MVC but I would stick with ASP.NET MVC these days as that is where the future lies. ASP.NET MVC is open source by the way and ships with Mono out of the box (the actual Microsoft code).
I can speak more to Rails than Mono. RoR is pretty scalable these days with all of the cloud hosting services available. Web applications query data and render web pages using that data, which really isn't that big of a deal. Most performance issues are caused by database and schema design issues, not the web framework. Typically, database response times dwarf other portions of server processing. RoR is also very easy to test. Testing is a more natural part of development than in other languages that I use. When I started RoR programming I was used to the much more structured world of Java, and the more dynamic Rails won me over for web development.
Firstly, I work on MonoDevelop, a crossplatform IDE for Mono (including ASP.NET & ASP.NET MVC), so feel free to consider my answer biased, but hopefully it will be helpful anyway.
Performance: a decent JIT compiler (Mono) should be much faster than an interpreter (Ruby). But it depends on the programmer's skill too - well-written Ruby could be faster than really badly written C#. The libraries and database and caching mechanisms you use will be a big factor too, but these aren't fundamental to the languages/frameworks.
Scalability: AFAIK there is no magic bullet for web app scalability, and although I don't have practical experience in this field, here's some info I've picked up. It really depends on your database usage, how your session state is stored, and how caching is implemented. This isn't really fundamental to either framework - once you start scaling to multiple machines, you'll probably have many machines/processes for database servers, cache servers, message queues, frontends, servers for static content, etc. Likely only the frontends will be ASP.NET or ROR, and if they're stateless, you can simply clone them and handle the scalability problems on the backend.
Testing: I can't speak for Ruby, but ASP.NET MVC (but not vanilla ASP.NET) was designed to be easily testable using .NET testing tools such as NUnit (Mono's own unit tests use NUnit).
Maintenance and development: Again, I can't really speak for Ruby, but it's pretty much a given that it will be easiest to develop (at least initially) in the language & framework that the developer already has experience with. Also, .NET has some amazing development tools on Windows - Visual Studio, ReSharper, etc. - and there's a huge pool of experienced C# and ASP.NET developers you can hire, though few of them will know Linux/Mono.
Also, StackOverflow uses ASP.NET MVC :)
To introduce a little levity...
How about DOS on Dope: the last MVC web framework you will ever need?
There are of course a dizzying array of choices but another nice alternative is Django.
It is basically Ruby-on-Rails for Python so most of the comparisons of RoR vs. ASP.NET MVC would apply. Depending on what kind of site you are building, the really interesting feature of Django is the automatic admin interface.
If you need to be up and running quickly, I would go for RoR. Scaling rails is becoming easier with time and you have a big range of ruby runtime environments to choose from MRI 1.8, 1.9, REE 1.8, JRuby (run on java VM), Rubinius.
ASP.NET MVC is nice, but I still think it has some way to go before it offers the same speed of development as RoR.

What ORM should I use for a ASP.Net MVC project?

I am starting a new ASP.Net MVC project and was wondering what is the best Model approach to take.
Most demos recommend LinqToSQL but I know Microsoft are not really enhancing this product and are focusing more on the Entity Framework.
I like the Subsonic approach but I thought this was going to be built in with MVC with version 3 but there has been no news about the development stage of this project so I am a bit wary of using version 2 if there is to be a new release soon.
I have heard of NHibernate and Castle Record but have not had any experience at all with these and have heard numerous pros/cons for both.
Any help would be highly recommended!
nHibernate learning curve is higher but worth it. Use Fluent nHibernate to ease the pain a bit. nHibernate is less visual that some ORMs but that is really only an issue when you are beginning and once you have experience with it the lack of visual designer is a benefit IMO.
For SubSonic, Rob just release an new MVC template which you can use when starting a new project that bakes a lot of good stuff into a new MVC project including a pre-release of SubSonic 3. Detais are available on Rob Conery's blog.
LLBLGenPro works great for me. It is the best .net ORM out there. I'd avoid Linq to Sql because you'll have problems once the project grows and it is rather weak in features (besides the obvious downsides, like works only with SQL Server, etc.)
I use linq2sql and I think it works absolutely great if you use MSSQL as your database (it works on other databases too, but it requires some 3rd party tools). Yes, Microsoft has 'discontinued' its development, but it is mature enough for the average project. I doubt you will run into any walls. If you're starting a big project that you need to support for years to come, then the Entity Framework might be more suitable.
I personally haven't used NHibernate and Subsonic before, but like Craig says, the learning curve of NHibernate is a bit more steep, though it is supposed to be a great framework (everything from what I heard or read).
If you're willing to spend some money or have a smaller project I'd at least try out LightSpeed. I found pain points withe very ORM I've ever tried and I'm currently using LINQ to SQL myself.
LightSpeed is pretty feature rich though the LINQ support is missing a few features nothing major that can't be worked around. It's pretty close to being the same as LINQ to SQL and LINQ to Entities but has a few more features like Full-text Search.
Castle ActiveRecord works really well for small-to-medium projects based on MVC - I'm using it on a couple of projects at the moment and finding it a very good fit with ASP.NET MVC.
It's an implementation of the active record pattern that uses NHibernate under the hood - in other words, as long as you're happy having one class per database table, it'll do most of the NHibernate configuration for you, leaving you free to write code like:
Customer bob = Customer.Find(/* customer Id goes here */);
bob.FirstName = "Robert";
bob.Save();
Invoice newInvoice = new Invoice();
newInvoice.Products.Add(Product.Find(/* product ID goes here */);
bob.Invoices.Add(newInvoice);
bob.Save();
with very little explicit NHibernate configuration (assuming you have Customer, Invoice and Product tables in your DB, of course)
Because it's NHibernate under the hood, migrating to NHibernate if you need to should be straightforward - you'll already have all the necessary references and libraries. There are a few aspects of NHibernate behaviour that you can't ignore (like session scopes and flushing) - but it's not too hard to work out what's going on with these, and using them in ActiveRecord will give you a head start if/when you need to move to using NHibernate directly.
We're using Fluent + NHibernate here, it works pretty well. Some alternatives that mesh well are SubSonic, Entity Framework, and Linq to SQL. I think straight NHibernate is a bit more cumbersome than it is worth, but is a great underlying layer with Castle ActiveRecord, and with Fluent.
I worked with a product called netTiers (http://www.nettiers.com/) on a project and that worked very well. It's a CodeSmith script that generates business objects from your database tables, views and stored procedures.
If it's not a huge project, I'd use Linq To SQL. If you need all the bells and whistles, bone up on nHibernate and have at it. I don't think you'd run in to any serious issues one way or the other.

ASP.NET MVC Development tool

Following on from my previous question, If I am beginning to learn asp.net MVC, will the express edition of visual studio web developer be enough, or should I consider the expensive full version of Visual studio. What are the limitation of such express version I may run into? or am I better using an Expression tool? (or is this something I can progress to later.) Any advice anyone? Thank you.
Re-sharper (everyones favourite add in ;-)) requires the full version of VS. It's worth getting for that reason alone in my view.
One thing that comes to mind is lack of the SQL tools in the express versions, such as the Server Explorer (http://msdn.microsoft.com/en-us/library/cd2cz7yy.aspx). I am not sure if you can effectively do LINQ to SQL or LINQ to Entities without it.
On that note, I strongly encourage the full version of Visual Studio 2008 Professional.
I know that since you are using the express versions, you qualify for the upgrade price for Visual Studio 2008 Professional.
On a side note: the Expression products are more geared for designers, not coders.
Express is definetly a good start, and if you're just learning you shouldn't miss some of the features from the full version too much. For SQL management, Microsoft now offers SQL Management Studio Express as well (along with SQL Server Express, of course).
The major things that I personally miss when I'm using Express rather than a full version are:
Class Diagrams - these are pretty useful when you're starting off a project and want to map out the classes you'll want to create. With a simple MVC application there probably won't be a huge need for them, however.
Attaching to a process for debugging - Express editions include the full debugger, but you can't attach to an already running process. This is particularly useful if you're using NUnit and you run into a problem and want to debug. There's some workarounds, but they aren't particularly elegant or simple.
Integrated testing - I'm actually surprised this wasn't included - Microsoft should realize that getting new developers to learn good habits like Unit Testing should be encouraged.
The Expression suite is targeted towards designers more than developers. I don't think it's a good fit for what you are looking for.
SharpDevelop is another free option. It's good if you find Express lacking, but I personally don't find the experience as "smooth", and it's particularly short on features relating to web development.
"Full versions" of Visual Studio are not free! If you are beginning to learn asp.net MVC, you shoud try Visual Web Developer first. Yes, it does not support integrated testing but you can use any 3d-party tool (xUnit is the best) for testing.

ORM for DELPHI win32

Does anyone know about an ORM or something similar for Delphi Win32.
Marco Cantu is a big believer in InstantObjects:
http://www.instantobjects.org/
Others include DObject:
http://www.macrobject.com/en/dobject/
and tiOPF
http://tiopf.sourceforge.net/Doc/overview/index.shtml
You also might be interested in the G Framework:
http://code.google.com/p/g-framework/
Another Open Source ORM for Delphi 6-XE2, which is JSON based and Client/Server.
Can use its own in memory database layer or embedded SQLite3 database engine:
http://blog.synopse.info/category/Open-Source-Projects/SQLite3-Framework
Edit: A lot of improvements to this active framework, since this question was answered. It is able now to connect to any third-party database, and is changing its name: it is now called the mORMot framework.
There are a few, some of the more tried and tested are...
Bold
TiOPF
And RemObjects also has a schema Mapping technology that is worth investigating
TMS Software is working on an ORM framework for Delphi: TMS Aurelius should be soon released :
TMS Aurelius
EDIT:
It's been already released, official site is http://www.tmssoftware.com/site/aurelius.asp
Another ORM for Delphi, which seems to be in active development, is hcOPF
The project is open source licensed under LGPL/MPL and hosted on SourceForge at http://sourceforge.net/projects/larryhengensopf/.
dorm, “The Delphi ORM” by Daniele Teti, was officially published at ITDevCon, there is an introduction here. It works with PODOs which have no knowledge of the ORM.
New in 2011: DORM - http://code.google.com/p/delphi-orm/. Some documentation can be found on author's blog.
Visit http://code.google.com/p/persiphi/ if your are addicted to Delphi 2010 or upper.
Edit:
Dead link as the owner likely has renounced to opensource it. Nevertheless, his master thesis work in portugese (pt-br) is still available here. A good source of inspiration for those in search of sample using latest bleeding edge features of Delphi (Annotation, Rtti...) in the realm of object persistence.
UPDATE 1:
DevArt has released EntityDAC - An ORM for Delphi with LINQ support!
It works even with D11 (Delphi 2007).
UPDATE 2:
Marshmallow ORM framework by Linas Naginionis.
It has joined join the outstanding Spring4D project as a feature branch as announced here.
To keep abreast of the latest news head to the Marshmallow Google+ thriving Community page.
Dubbed MM ORM Framework by its author, it's a promising one.
Jazz SDK, ORM is a part of the OPF part
http://jazz-sdk.googlecode.com
Here you have one: http://code.google.com/p/delphiorm/
I tried Remobject Data Abstract for 1-2 year in some real world projects.
Some features are good (a very good binary comunication protocol), some other are simply pitfalls (it adds a something of chaotic code and you have to pass dialog by dialog every change you made on the schema).
It's good you define a schema of the model, it's bad you miss much of the power of SQL (es grouping by, a easy to use join, ecc).
I think that it's hard to fit a good ORM on top of the old VCL and TDataSet.
DatAbstact was a try but at the end I rewrited my application in another language because a good ORM and a good framework is a must have for a good application.
VCL is simply too old to fit well with modern concepts of application development.
Anyway i tried InstantObject and Bold, are two good ORM frameworks but not more supported.

Resources