|
Honestly, ORMS are a square-peg/round-hole kind of solution.
Objects represent data hierarchically(sp?), RDBMS's represent data relationally. There is no sane way to glue the different models together in the general case. It's not even about speed, it's about RDBMS design - ORM's that "work" work by duplicating everything in the object hierarchy in some way or another, or produce so many relational links your DB will grind to a halt on even the most simple object storage/retrieval.
What you can (and should) do is (like the other poster said) write your database abstraction layer to turn objects into relations and vice-versa. At the abstraction layer you need to keep the object hierarchy pretty flat (1 level deep). Your program will then construct the objects into the hierarchy from the table abstraction.
|
|
|
|
|
I looked up ORM in Wikipedia. The following caught my eye:
Quote: Comparison with traditional data access techniques
Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written.[2]
Disadvantages of ORM tools generally stem from the high level of abstraction obscuring what is actually happening in the implementation code. Also, heavy reliance on ORM software has been cited as a major factor in producing poorly designed databases.[3]
My nature, such as it is, would push me towards the roll-my-own methodology.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
That sounds correct to me, I think ORM's can be useful, but in our case I think it is not the best solution
|
|
|
|
|
ORMs are excellent choices for existing, large-scale database systems where you need to create data access capabilities rather quickly (ie: for a new application that will access the database).
However, in general, and especially for small to medium sized databases, an ORM is rather inefficient and a good data access layer should used instead.
You also have to remember that using an ORM where the developers are not familiar with it will take take time to learn...
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com
|
|
|
|
|
|
I would advocate against ORMs in general. Only make your code as complicated as it needs to be. ORMs tend to abstract a bit too much and there can be needless repition in code due to ORM limitations. IF you must use one, use a light weight one like Dapper.
|
|
|
|
|
I once read an article that proposed ORM as an anti-pattern. Base on my limited use of NHibernate and other ORM tools, I would tend to agree.
|
|
|
|
|
Not if you want to stay in control
The perfect woman: cooks good food and never says no in the middle of the night.
|
|
|
|
|
...not to ORM
|
|
|
|
|
Even for my "hobbies" now, I use Entity Framework (EF ORM).
Using "code first", your POCO's can generate the data base (local file; sql express; standard):
db.Initialize().
(Handy when "importing" 3rd party xml-type data bases).
Access using LINQ; with or without lazy loading.
Using a repository pattern, you centralize and "standardize" your access methods for "that" db context. Helps the thought process.
Change your "data model" in code and recreate your db with one line of code.
NuGet manages all the EF dependencies.
In your case, using EF "database first", it's a simple matter to generate your "entities"; and "expand" them using partial classes. You can then "convert" to "code first" for continued development.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
We use the eXpressPersistent Objects™ (XPO) DevExpress[^].
It can do all we need (and we require a lot...).
XPO is very well documented and when you need support, DevExpress answers questions quickly with a solution.
Most of the time you find an answer in the support center history.
Under others, this ORM supports 12 RDBMS and can work even with totally broken DB designs, for example with 30 year old legacy tables...
|
|
|
|
|
Speed and performance are important factors
IMHO:
- 1: Generally allow for speedier development for developers so they appear to have higher performance.
- 2: "Raw" SQL generally is speedier allowing the allowing the program to achieve higher performance.
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
Thanks, that seems correct to me, the more I read about NHibernate the more confusing it gets, so I'm not convinced that it is a good solution for us.
My first impressions are not positive I have to admit, the learning curve seems steep.
But management has decided that we will give it a go, so we will see how far we get with it ...
|
|
|
|
|
We use a tech stack that includes NHibernate in our enterprise environment and rarely have issues. It helps with TDD. I would suggest pairing it with a good IoC Container (like AutoFac) though. Side note, you can run raw SQL, HQL or execute stored procedures from NHibernate.
Here is our server side stack:
C# (WebApi)
AutoFac (IoC Container)
Fluent NHibernate (ORM Tool)
MsTest (Testing Framework)
Sqlite - InMemory Database configuration (Used in unit testing)
MSSQL Server - Production
NHiberante ASP.NET Identity
OAUTH/OWIN Middleware Implementation
Client Side:
Twitter Boostrap (Front-end framework HTML framework)
Typescript (Staticly typed, Class-based Transcompiler to JavaScript)
AngularJS (MV* Framework)
UI Bootstrap (Bootstrap components written in AngularJS)
Font Awesome (Icon Framework)
Jasmine (Javascript/Typescript Testing Framework)
Eric
|
|
|
|
|
I'm looking at WPF vs UWP for a consumer facing kiosk app.
WPF I know is doable, since it can be bundled up into an .msi and then tied into an off the shelf auto-update platform.
For UWP, I see sideloading is doable via turning on a setting and installing a signing key. That's obviously a bit more work up front; but should be doable for initial install by whoever is setting them up at the manufacturing/assembly point (and might be able to be baked into a factory image).
What I'm not sure is if there's going to be an ongoing maintenance penalty from doing so, in terms of additional work needed to update the app after the kiosk is deployed, or other gotchas I'm not aware of.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I'm not sure what it is really like as an ongoing thing but I have documented the basics of side-loading in my book Programming Windows Desktop Via UWP in chapter 13 which you can read here:
Programming Windows 10 Desktop: UWP Focus (13 of N)[^]
Mostly, it is just a bunch of esoteric things you need to know ahead of time.
Maybe the article's walkthru and screen shots will provide a bit of info that will help you.
|
|
|
|
|
Thank you. That looks like the exact sort of information I need to get my research started.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
That's great. So glad I could help out. Thanks for letting me know.
|
|
|
|
|
I found that auto updating a side loaded app wasn't the most straightforward of tasks in the world. In the end, I went with a version of this[^] as a means of updating. Apart from that, it's not too complicated to do (note, this was before the Fall Creator update which has enhanced the side loading capabilities a fair bit so you might not need to do this anymore).
|
|
|
|
|
that page was on my list of things to give a try. Some of the comments on the post by people who couldn't make it work had me concerned it wasn't a complete solution.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I really need to try the Fall Creators side loading to see what's been updated (no pun intended).
This space for rent
|
|
|
|
|
Are there any gotchas I should be aware of? One of my coworkers tried sideloading years ago (might've been 8.x not 10) but got burned when the sideloaded installs all expired after a few (2?) months.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
W10 updated the Sideload experience a lot. I have one app that's been side loaded for about 16 months now and it hasn't complained.
This space for rent
|
|
|
|
|
Good to know that MS has been streamlining the process away from the initial use the store or off approach they took when W8 came out.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I think I understand why that blog post has a lot of not working comments. It doesn't appear to be quite complete, and as someone not familiar with UWP I'm also struggling to figure out how to get everything connected.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|