asp.net - Linq queries in UI code: do you regard this as a no-no? -


ah, i'm getting warning saying question 'appears subjective , closed'. think it's pertinent , important question architectural design.

all programming years have been told sql statements being created , executed directly within ui code (for example asp.net page codebehind) massive code smell , data access , presentation concerns should @ opposite ends of application's layers.

nowadays have shiny data access layer using nhibernate entities via repository pattern. , i'm finding myself writing linq queries directly in ui code!

part of me thinks same writing sql queries in ui code, dressed in smarter clothes.

the other part of me says linq queries tip of sophisticated abstraction layer separating ui code internals of database, , if didn't use linq queries in page have add one-off 'report' methods repository getallfooswithrednosesandsleighbells(), think of anti-pattern.

what think? i'll give answer whoever makes strongest argument (in subjective view, answers on stack overflow).

personally have used linq objects in ui layer - doing manipulating list of objects have been delivered ui layer via mechanism.

as using linq query nhibernate based data layer - wouldn't @ ui layer, quite ui layer presentation. instead should use pattern mvvm/mvc/mvp/whatever rocks boat, , put linq query component feeds ui layer, i.e. put in model if using mvvm pattern.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -