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


27 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!

Unknown 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

Unknown 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

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

Unknown 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

Anonymous 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?

ajudan pk said...

I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
cara menggugurkan kandungan

Pengobatan Sakit Pinggang Secara Cepat & Efektif said...

It is great to have visited your website. Thanks for sharing useful information. And also visit my website about health. God willing it will be useful too

Pengobatan Alternatif Penyakit Hepatitis
Obat Tradisional Cedera Lutut/Keseleo Lutut
Obat Penambah Berat Badan Alami
Cara Mengatasi Sakit Perut saat Haid
Obat Herbal Penghancur Miom

Unknown said...

cara menggugurkan kandungan kandungan dengan cepat dan akurat terbukti ampuh untuk melunturkan janin kehamilan muda 1 minggu hingga 1 , 2 , 3 dan 4 bulan
obat penggugur kandungan adalah suatu bentuk proses berakhirnya kehamilan dengan dikeluarkannya janin ( fetus ) atau embrio sebelum memiliki kemampuan untuk berkembang dan bertahan hidup diluar rahim , sehingga bisa menyebabkan kematiannya pada janin
Disini akan kami beritahukan kepada Anda langkah cara cepat menggugurkan kandungan dengan cepat dan selamat adalah KURET dan obat aborsi
Kunyit memang tidak di baik di konsumsi oleh ibu hamil yang sedang hamil muda sehubungan dengan sifatnya untuk melancarkan haid , dan di percayai sebagai obat telat datang bulan
jual obat aborsi paling manjur Misiprostol Cytotec asli terbukti ampuh melunturkan janin kuat tanpa kuret dengan bersih untuk usia 1 , 2 , 3 sampai 4 bulan dengan aman

Nora Pittman said...

Crypto-currency as a modern form of the digital asset has received a worldwide acclaim for easy and faster financial transactions and its awareness among people have allowed them to take more interest in the field thus opening up new and advanced ways of making payments. Crypto.com Referral Code with the growing demand of this global phenomenon more,new traders and business owners are now willing to invest in this currency platform despite its fluctuating prices however it is quite difficult to choose the best one when the market is full. In the list of crypto-currencies bit-coins is one of the oldest and more popular Crypto.com Referral Code for the last few years. It is basically used for trading goods and services and has become the part of the so-called computerized block-chain system allowing anyone to use it thus increasing the craze among the public, Crypto.com Referral Code.

Common people who are willing to purchase BTC can use an online wallet system for buying them safely in exchange of cash or credit cards and in a comfortable way from the thousands of BTC foundations around the world and keep them as assets for the future. Due to its popularity, many corporate investors are now accepting them as cross-border payments and the rise is unstoppable. With the advent of the internet and mobile devices,information gathering has become quite easy as a result the BTC financial transactions are accessible and its price is set in accordance with people’s choice and preferences thus leading to a profitable investment with Crypto.com Referral Code. Recent surveys have also proved that instability is good for BTC exchange as if there is instability and political unrest in the country due to which banks suffer then investing in BTC can surely be a better option. Again bit-coin transaction fees are pretty cheaper and a more convenient technology for making contracts thus attracting the crowd. The BTC can also be converted into different fiat currencies and is used for trading of securities, for land titles, document stamping, public rewards and vice versa.

Another advanced block-chain project is Ethereumor the ETH which has served much more than just a digital form of crypto-currency Crypto.com Referral Code and its popularity in the last few decades have allowed billions of people to hold wallets for them. With the ease of the online world,the ETH have allowed the retailers and business organizations to accept them for trading purposes, therefore, can serve as the future of the financial system.

freya maya said...

Crystal online pharmacy is a trusted online drug store with a wide range of products to suit the needs of our clients. Buy Abortion medicine online Crystal Pharmacy do strive to offer the best service and ship products world wide. All the products listed on our website are Ava in stock. Expect your order to be processed Immediately when you send us your request. We deal with varieties of drugs for our customers satisfaction. We cross barriers with our products and struggle hard to meet human satisfaction. When shopping with us, Be safe and secured and you will realize how swift we are with our services.

freya maya said...

Universal Gun sales is a trusted Firearm company base in Los Angeles California USA. It is one of the top Firearms Company in this part of the country. Buy suppressors online They do offer the best firearms deal in the USA and to over 25 countries in the world. You can always visit their shop in Los Angeles using the address on their website. Place your order and get served by the best Firearm Company in the planet. Have fun.

Nora Pittman said...

PG SLOT มีเกมหลากหลายให ้เลือก พรอ้ มกราฟฟิกแอนนเิมชนั่ สวยงามทสี่ ดุ ในยคุ นี้แจ็คพอตแตกง่าย pgslot โปรโมชนั่ พเิศษส าหรับทงั้สมาชก เกา่ และสมาชกิ ใหม่ ระบบฝาก-ถอนเงินออโต ้เงินเข ้าเร็วทันใจมีแอดมิ ดูแลตลอด 24 ชวั่ โมง ต ้องที่ pgslot.bid มั่นคงจ่ายจริง ไม่ว่าคุณจะถอนเงิ มากมายเท่าไหร่ ทางเว็บจ่ายเต็มไม่มีหัก pgslot ปั่นง่ายแตกง่าย

PG SLOT ผู ้ให ้บริการเว็บตรง ที่แตกง่ายที่สุด ปั่นสนุก ฝากเงินรับเครดิตฟร สูงสุด 15000 บาท สมัคร พีจีสล็อต หรือ PGSLOT กับเราเพื่อความมั่นคงของคุณเอง.

sr said...

토토사이트 이용을 하다 보면 먹튀 피해에 대한 두려움이 갑자기 생기거나 두려움을 가지고 이용하는 경우가 대반사입니다. 토토마추자는 그러한 두려움을 없애드리기 위해 만들어진 먹튀검증커뮤니티 입니다. 다양한 검증 활동을 통하여 축적된 데이터로 방문해 주시는 모든 회원님들께 무료로 제공해드리고 있습니다. 토토사이트를 이용 하는 회원님들은 메이저사이트를 이용하고 싶은 마음이 크다는 걸 알 수 있습니다. 하지만 해당 토토사이트가 메이저인지 아닌지 확인할 방법은 민간인에게 어려움이 있다는 걸 알 수 있습니다. 이용전 꼭 토토마추자를 통하여 먹튀검증 서비스를 받아보시기 바랍니다안전놀이터.
국내에 합법 토토사이트는 배트맨토토 에서 발매하는 정식서비스만 이용을 할 수 있으나 배팅금액 제한이 있기에 우후죽순 사설토토사이트가 생겨나고 있습니다. 대체적으로 이를 방지를 하려면 배트맨토토 자체에서 배팅금액 한도를 늘리는 수밖에 없다고 생각됩니다.

freya maya said...

forum posting refers to generating quality incoming links by taking part in online discussion forums. It permits you to post new posts and reply to previous ones to drive traffic to your web site.

Click here for more said...

พวกเราหลายคนเคยเล่นสล็อตแมชชีนในชีวิตของเรา แต่เกมนี้เกี่ยวกับอะไรกันแน่? สล็อตแมชชีนเป็นอุปกรณ์ที่สร้างตัวเลขสุ่มที่สร้างเกมแห่งโอกาสให้กับลูกค้า สล็อตมีหลายประเภท รวมถึงเครื่องโป๊กเกอร์ เกมพักกี้ และเครื่องผลไม้ จุดประสงค์ของเกมเหล่านี้คือการสร้างรายได้ให้กับลูกค้าผ่านการผสมผสานระหว่างโอกาสและทักษะ อย่างไรก็ตาม ประเภทสล็อตที่ดีที่สุดในการเล่นออนไลน์คือสล็อตวิดีโอ สมัครสล็อต
การจ่ายเงินในเกมสล็อตจะถูกกาหนดโดยผู้พัฒนา สิ่งสาคัญคือต้องตรวจสอบการจ่ายเงินสาหรับเกมเหล่านี้ก่อนเดิมพัน คุณสามารถทาได้โดยทาการค้นหาโดย Google หรืออ่านบทวิจารณ์บนเว็บไซต์ที่มีชื่อเสียง บางเว็บไซต์มีฟอรัมผู้ใช้ซึ่งสามารถให้ข้อมูลที่มีค่าสาหรับผู้เล่น การเลือกคาสิโนออนไลน์ที่เหมาะสมเป็นสิ่งสาคัญสาหรับความปลอดภัยและความเพลิดเพลินของคุณ แต่คุณต้องระวังไม่ให้ติดเกม หากคุณเป็นมือใหม่ คุณควรเริ่มต้นเพียงเล็กน้อยและเพิ่มการลงทุนเมื่อคุณได้รับประสบการณ์มากขึ้น เพื่อให้แน่ใจว่าคุณกาลังเล่นที่คาสิโนออนไลน์ที่มีชื่อเสียง อ่านบทวิจารณ์เกี่ยวกับเว็บไซต์
ค้นหาความคิดเห็นจากเพื่อนเกมเมอร์ ยังเลือกคาสิโนที่มีชื่อเสียงที่สุด บางเว็บไซต์มีการตรวจสอบสถานะและมีฟอรัมสาหรับผู้เล่นจานวนมาก ด้วยวิธีนี้ คุณจะมีความคิดที่ดีขึ้นว่าเกมสล็อตใดเกมหนึ่งยุติธรรมหรือไม่ และคุณควรเดิมพันเท่าไร การเล่นบนเว็บไซต์ที่มีชื่อเสียงย่อมดีกว่าเว็บไซต์ที่มีชื่อเสียงน้อยกว่าเสมอ ในบรรดาตัวเลือกออนไลน์ที่หลากหลาย การเลือกคาสิโนที่มีชื่อเสียงเป็นสิ่งสาคัญ ตรวจสอบให้แน่ใจว่าคาสิโนมีชื่อเสียงที่ยอดเยี่ยมเพื่อหลีกเลี่ยงการหลอกลวง ด้วยการค้นหาโดย Google อย่างรวดเร็ว คุณจะพบบทวิจารณ์คาสิโนที่ให้ผลตอบแทนดีที่สุด บางเว็บไซต์มีฟอรัมที่ผู้เล่นสามารถพูดคุยเกี่ยวกับประสบการณ์ของตนกับคาสิโนได้ เมื่อคุณเลือกคาสิโนออนไลน์ ให้หาข้อมูลก่อนเล่นเสมอ และถ้าคุณมีเวลาลองอ่านรีวิวคาสิโนก่อนเริ่มเล่น สมัครสล็อต ก่อนเล่นเกมสล็อตออนไลน์ คุณควรศึกษาข้อมูลให้ดีเสียก่อน คุณต้องการค้นหาคาสิโนที่ขึ้นชื่อเรื่องความซื่อสัตย์และความน่าเชื่อถือ เป็นความคิดที่ดีที่จะอ่านบทวิจารณ์ของผู้ใช้ในไซต์ต่างๆ แม้ว่าบางเว็บไซต์จะใหม่ แต่บางเว็บไซต์ก็เป็นที่ยอมรับและมีประวัติที่พิสูจน์แล้ว ไม่ต้องกังวลหากคุณสามารถไว้วางใจคาสิโนด้วยเงินของคุณ อันที่จริงแล้ว ไม่มีอะไรสาคัญไปกว่าความสนุกสนานขณะเล่น มีคาสิโนออนไลน์มากมายที่ให้บริการเกมสล็อต และสิ่งสาคัญคือต้องเลือกคาสิโนที่มีชื่อเสียงเพื่อให้แน่ใจว่าคุณมีประสบการณ์ที่ดี คาสิโนที่ดีจะมีการรีวิวจากผู้เล่นจริง และบางแห่งก็จะมีบริการลูกค้าที่พร้อมให้บริการทุกวันตลอด 24 ชั่วโมง คุณควรรู้ว่าคุณกาลังทาอะไรอยู่เมื่อเล่นออนไลน์ คุณจะต้องการเล่นเพื่อความสนุกสนาน แต่คุณไม่ควรถูกล่อลวงให้เสี่ยงเงินของคุณ!

Nora Pittman said...

We're more than just a san diego web design Company. With our full-service digital marketing packages, you can get the most out of your online marketing

Click here for more said...

Freelancers Incubator is a European educational institution specializing in the field of freelancing and fersonal growth. Become a freelancer

Nora Pittman said...

Spectrum tv on firestick: Are you searching for the best cord-cutter to install and stream on your Firestick? Then you are in the right place. Yes, today I’m going to guide you on how to download and install Spectrum TV on Firestick?
I’m glad to inform you that Spectrum TV is one of the best streaming services to stream live TV channels and on-demand content on your Firestick. If you are wondering how to get rid of your cable services, continue reading the below guide. Come, let’s get into the content.

rj said...

Just 99 Web Design offers affordable web design packages for every business, from basic one-page websites to full eCommerce website design services. inexpensive web design companies