Monday, March 29, 2010

ORM Condemnation (....Continued)

Did I tell you that I am not a fan of OR Mapping solutions at all?
Why?
Because of concept and code bloat and very little benefit (if any). I am teaching developers this way:

Majority of business applications are comprised of 3 major parts:

a. Master Data - such as dictionaries and support tables
b. Normal Processing/OLTP  - used every day, this is what app is used for, usually real-world data is keyed on [a] and stored depending on some sort of a date/time key
c. Reports - query transactional-accumulated(or live) data (entered in [b]) , join it with master data for descriptions and output to user

The fact of life is that "Master Data" tables (hundreds of them in big systems) are very dummy in the most cases, and any credible architect
 would build interfaces/CRUD logic in a template-based way. For those templates(base classes probably) SQLs are usually very simple, the row count is mostly <1000 per table (not always),
 and really there is NO BUSINESS logic needed to be applied but map SQL columns to on-screen controls (be it Forms, Web or anything else). Making developer
 maintain a bloat of 100s of classes just to map A to A does not make much sense. What does make sense - build your general ancestor class smart enough
 to supply tons of metadata from your back-end automatically (such as max-length, required(not null), format etc...). I don't really need to map DB to object for that.

Now about [b] item - OLTP screens or entry processes(be it GUI or ETL or...who knows). Those definitely need to go through good interface in terms of classes, but again, if you have ever built 
 "big" software that contains 100s of data-entry screens - the pattern becomes trending - you are NOT dealing with simple SQLs - now when user hits  "Save"
 you probably touch 3-10 tables etc. I personally never user ORM for that but write classes by hand with plenty of XML comments and human methods
 that are centered around business , not around schema. Database schema is designed for normal-forms compliance (most of the times), not class/interface
usability by developers. So, in a financial system, I would have "Portfolio" class and "Save" method, and maybe even "IStorage" provider that implements
 direct SQL backing store so portfolios could save ,or maybe middle-tier store. So SQL is not the sole solution now.
 The hand-written code makes sense though, and there is no bloat. Using LINQ to SQL would not have helped really as "Save" method for portfolios
 touches 10s of tables due to business rules. And I don't really want to have database code in C#, maybe database orchestration code I do, I'd rather use stored proc, or maybe some other middle tier process as an abstraction layer. So now I need to use ORM there, again, I need to write good well-though queries that don't put unneeded locks etc..
So what benefit does LINQ to SQL/Hibernate/EF or any other tool would give in my case?  None. 


Check out this link regarding Microsoft ORM technologies trending:

http://www.infoq.com/news/2008/11/DLINQ-Future


21 comments:

Anonymous said...

you may have a point but I do not agree completely, your "IStore" layer can be just as well coded in LINQ to SQL or the like. I see what you imply with "dummy" screens though

Anonymous said...

LINQ to S is good for fast ans simple apps, not for the systems you describe with 100s screens

Anonymous said...

i hate stupid orms. they are not godd for anything but toy apps that the industry likes so much in their tutorials. great post bro!

mao yun said...

1
instyler ionic styler
cheap soccer jerseys
tiffany and co jewelry
ghd hair straighteners
louboutin shoes
valentino sale
asics running shoes
adidas shoes
hollister
michael kors outlet online
jordan 4
insanity
christian louboutin
air jordan concord
giuseppe zanotti sale
cheap nba jerseys
insanity max 30
lacoste outlet
abercrombie and fitch
soccer jerseys
salomon running shoes
christian louboutin outlet
coach outlet store online
toms outlet
hollister clothing store
toms outlet
kate spade handbags
polo lacoste pas cher
cheap snapbacks
adidas outlet
babyliss
fred perry sale
christian louboutin outlet
pandora charms
discount oakley sunglasses
mlb jerseys wholesale
salomon shoes
ralph lauren outlet
converse outlet
ray ban aviator sunglasses
michael kors uk
20150326maoqiuyun

Weiming Zhu said...

ugg boots
air jordan 13
air jordan shoes
beats headphones
bottega veneta outlet
burberry outlet
canada goose outlet
chanel outlet
cheap wedding dresses
coach outlet
dansko outlet
evening dresses
hermes belt
hermes birkin
hermes outlet
juicy couture outlet
kate spade outlet
mbt shoes
michael kors outlet
mizuno running
moncler coats
mulberry outlet
soccer shoes
nike outlet store
the north face outlet
oakley sunglasses
ray ban sunglasses
stuart weitzman boots
surpa sneakers
north face outlet
the north face clearance
the north face jackets
the north face outlet store
north face jackets
the north face uk
tommy hilfiger outlet
tory burch outlet
true religion jeans
vans shoes
ysl outlet

Meiqing Xu said...

20150623meiqing
louis vuitton
louis vuitton
fitflop footwear
oakley store
kate spade outlet
ralph lauren outlet
ray ban sunglasses
jordan 8 playoffs
oakley vault
toms outlet
www.louisvuitton.com
hollister
jordan concord 11s
michael kors outlet online
chanel bags
christian louboutin outlet
coach outlet
fitflops clearance
louboutin
louis vuitton outlet
coach outlet
coach outlet store online
marc jacobs handbags
toms promo code
oakley sunglasses wholesale
lebron james basketball shoes
prada
jeremy scott shoes
oakley sunglasses
abercrombie outlet
louis vuitton
discount oakley sunglasses
christian louboutin outlet
michael kors uk
ray ban wayfarer
concords 11
kd shoes
kate spade handbags
pandora charms
abercrombie & fitch

oakleyses said...

kate spade outlet online, nike air max, tory burch outlet online, ugg boots clearance, prada handbags, nike air max, ray ban sunglasses, michael kors handbags, chanel handbags, jordan shoes, nike outlet, longchamp outlet online, gucci handbags, christian louboutin, christian louboutin shoes, burberry outlet online, ugg outlet, oakley sunglasses, louis vuitton outlet, ray ban outlet, nike free, cheap oakley sunglasses, cheap ugg boots outlet, louis vuitton, longchamp outlet, michael kors outlet online, polo ralph lauren outlet, burberry outlet online, christian louboutin outlet, michael kors outlet online, oakley sunglasses, ray ban sunglasses, oakley vault, ugg australia, cheap ugg boots, red bottom shoes, replica watches, michael kors outlet, tiffany and co, tiffany jewelry, louis vuitton outlet online, replica watches, polo ralph lauren, prada outlet, louis vuitton handbags

oakleyses said...

guess pas cher, nike air max, nike roshe run, mulberry uk, coach outlet, true religion outlet, true religion outlet, new balance pas cher, abercrombie and fitch, longchamp, nike air max, scarpe hogan, air max pas cher, sac vanessa bruno, ray ban pas cher, nike roshe, north face, coach purses, burberry pas cher, nike free pas cher, lacoste pas cher, timberland pas cher, coach outlet, michael kors uk, michael kors, nike free, longchamp pas cher, tn pas cher, hollister uk, vans pas cher, true religion jeans, ray ban uk, true religion, michael kors outlet online, north face pas cher, hermes pas cher, air jordan, lululemon outlet online, hollister, michael kors canada, louboutin, nike blazer pas cher, kate spade outlet, coach outlet store online, oakley pas cher, converse pas cher, nike air force, ralph lauren uk, air max, ralph lauren pas cher

oakleyses said...

nike air max, longchamp, new balance outlet, oakley, mcm handbags, nike roshe, ferragamo shoes, nfl jerseys, asics shoes, ralph lauren, celine handbags, mont blanc pens, hollister, s6 cases, baseball bats, soccer jerseys, nike air huarache, p90x workout, hollister clothing store, bottega veneta, giuseppe zanotti, insanity workout, abercrombie and fitch, ghd, iphone cases, valentino shoes, mac cosmetics, herve leger, iphone 6 cases, iphone 5s cases, lululemon outlet, instyler ionic styler, north face jackets, vans outlet, wedding dresses, soccer shoes, north face jackets, jimmy choo shoes, iphone 6s plus cases, birkin bag, beats headphones, timberland boots, nike trainers, iphone 6 plus cases, louboutin, reebok shoes, babyliss, chi flat iron

oakleyses said...

pandora jewelry, swarovski uk, canada goose, moncler outlet, links of london uk, coach outlet, ugg boots, hollister canada, sac lancel, marc jacobs handbags, air max, pandora jewelry, converse, replica watches, vans, wedding dress, uggs outlet, canada goose pas cher, canada goose, uggs canada, louis vuitton uk, moncler, barbour, gucci, supra shoes, moncler outlet, canada goose, canada goose outlet, doke gabbana outlet, moncler, juicy couture outlet, sac louis vuitton, canada goose, canada goose outlet, montre femme, thomas sabo uk, ugg soldes, louis vuitton, louis vuitton pas cher, moncler, swarovski jewelry, michael kors outlet online, louis vuitton canada, barbour jackets, converse shoes, ugg, canada goose outlet, ugg, ray ban, karen millen, moncler

mmjiaxin said...

marc jacobs
nike foamposite
vans shoes
calvin klein outlet
ralph lauren outlet
michael kors outlet online
swarovski crystal
ferragamo outlet
cheap nike shoes
michael kors handbags sale
oakley,occhiali oakley,oakley italia,oakley occhiali,oakley sunglasses
moncler outlet store
the north face outlet
michael kors factory online
ralph lauren uk
nike air max
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
longchamp outlet
michael kors wallet sale
michael kors outlet
mm1202

方松腾 said...

ugg boots
cheap oakley sunglasses
true religion sale
air jordan 11 free shipping
toms outlet
louis vuitton outlet
michael kors outlet,michael kors outlet online,michael kors,kors outlet,michael kors handbags,michael kors outlet online sale,michael kors handbags clearance,michael kors purses,michaelkors.com,michael kors bags,michael kors shoes,michaelkors,cheap michael kors
north face jackets
ferragamo shoes
soccer jerseys,soccer jerseys wholesale,soccer jerseys cheap,soccer jerseys for sale,cheap soccer jersey,usa soccer jersey,football jerseys
ugg boots on sale
vans sneakers
oakley sunglasses
fitflops outlet
coach outlet online,coach purses,coach handbags,coach bags,coach handbags sale,coach handbags outlet

Cran Kate said...

Tory Burch Flats Marc Jacobs Handbags Jimmy Choo Shoes Jimmy Choos True Religion Outlet ED Hardy Outlet
Burberry Belt Tory Burch Boots Louis Vuitton Belt Ferragamo Belt Marc Jacobs Handbags Lululemon Outlet Christian Louboutin Shoes True Religion Outlet Tommy Hilfiger Outlet
Michael Kors Outlet Coach Outlet Red Bottoms Kevin Durant Shoes New Balance Outlet Adidas Outlet Coach Outlet Online Stephen Curry Jersey Vans Outlet Ralph Lauren Outlet
Ugg Boots Sale UGGS For Women Skechers Go Walk Adidas Yeezy Boost Adidas Yeezy Adidas NMD Coach Outlet North Face Outlet Ralph Lauren Outlet Puma Outlet Polo Outlet

chenlili said...

michael kors outlet clearance
adidas shoes
ray ban sunglasses
hermes handbags
ugg outlet store
cheap jordans
ugg boots paris
uggs outlet
rolex watches
coach factory outlet
louboutin shoes
michael kors outlet online
louis vuitton outlet
ugg canada
polo ralph kids
michael kors outlet online
moncler jackets
timberlands
louis vuitton handbags
louis vuitton handbags
nhl jerseys
coach outlet store online clearances
louboutin femme
christian louboutin shoes
christian louboutin sale
louis vuitton outlet
gucci outlet online
ralph lauren outlet
coach factory outlet
michael kors handbags
uggs
ray ban sunglasses
hollister clothing
christian louboutin outlet
ray ban sunglasses
cheap oakleys
fitflops shoes
michael kors outlet
chenlili20160829

chenlina said...

ugg boots paris
louis vuitton outlet
minnesota vikings jerseys
coach outlet
washington wizards jerseys
fitflops sale clearance
ray ban sunglasses
cheap oakley sunglasses
ugg boots
oakley sunglasses
chenlina20161027

chenlina said...

chenlina20161027
michael kors outlet
ugg outlet
ray bans
fitflop shoes
seattle seahawks jerseys
cheap ray ban sunglasses
kate spade outlet
los angeles clippers jerseys
adidas outlet
oakley sunglasses

Unknown said...

carolina jerseys
texans jerseys
tiffany and co
instyler max
hermes belts
michael kors handbags
seahawks jersey
michael kors outlet
the north face outlet
replica watches

Unknown said...

nike trainers uk
ecco shoes
oakley sunglasses
louis vuitton sacs
san diego chargers jerseys
michael kors handbags
asics shoes
adidas nmd
ralph lauren pas cher
michael kors handbags wholesale

GIL BERT said...

adidas nmd
philadelphia eagles jerseys
patriots jerseys
ed hardy clothing
omega watches for sale
coach handbags
detroit lions jerseys
cheap ray bans
ecco shoes
chicago bulls jersey

John said...

coach outlet online
tods outlet
columbia outlet
nike air max 95
coach outlet online
pandora jewelry store
coach handbags outlet
coach factory outlet online
kate spade outlet online
nike air max
20170704yuanyuan

Thu Lê said...

I was very impressed by this post, this site has always been pleasant news. Thank you very much for such an interesting post. Keep working, great job! In my free time, I like play game: superfighters2.net. What about you?