Ad hoc query interface for business objects

Ad hoc query interface for business objects

Old forum URL: forums.lhotka.net/forums/t/348.aspx


steve10012 posted on Monday, June 12, 2006

Greetings !

I'm going to need to design a web-based interface to allow users to retrieve lists of business objects based on complex combinations of BO attributes

Does the framework have any built-in capabilities that I can take advantage of ... I hope that I do not have to resort to building a function that simply creates the Where clause of the query string. ( the attributes/columns that are returned are not an issue ... they will be fixed in all cases)

Thanks,

Steve

matt tag replied on Monday, June 12, 2006

nothing built in - I went with the "where clause" route myself.  My complex criteria is actually a recursive object structure (so you can 'and'/'or' multiple clauses together), with a lot of hardcoded stuff to build the final where clause.

matt tag

jwooley replied on Monday, June 12, 2006

Personally, I would recommend looking into LINQ depending on our deployment timeline. To do ad-hoc querying, you would still need to build expression trees dynamically using that as well so your mileage may vary.

For me, reporting is more a feature of the database and, although I try to use CSLA for application development, I have no problems stepping back to more direct sources for reporting purposes. Let the database do what it is made for, querying. There is no need to fill an object tree to replicate your database just for querying purposes. Also, you typically do not benifit from execution plans and indices when querying using object structures directly.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx

guyroch replied on Monday, June 12, 2006

I agree with Jim.  Here's another link to LINQ. 

http://msdn.microsoft.com/data/ref/linq/ 

If you can't wait for LINQ, then you should definitely consider an existing ORM, such as LLBLGen Pro or NHibernate.  Either way you'll have to tell you DAL what is the "where" clause no matter what.  No magic button here.

ajj3085 replied on Monday, June 12, 2006

See also this thread, which talks about the same topic:  http://forums.lhotka.net/forums/thread/1080.aspx

Copyright (c) Marimer LLC