Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Polita Paulus - BLINQ

Download

Right click “Save as…”

Meet Polita Paulus, software engineer who works on the ASP.NET team and wrote many of the data controls you use every day. She is also responsible for (she wrote it) a new ASP.NET technology known as BLINQ, which is a tool that enables ASP.NET developers to write LINQ queries (without knowing LINQ)! Cool stuff. 

BLINQ site

Brad Abrams on BLINQ

Tags:

Follow the Discussion

  • It sounds like RoR Scaffolding! That's great to see this incorporated into ASP.net.

    Now brace yourself for the criticism and misunderstanding of "code generation"...
  • William Staceystaceyw Before C# there was darkness...
    Love it.  Perfect/natural idea.  I need BLINQ for WinForms and WPF.  So you can right-click and BLINQ to ASP, or WinForms, or WPF.  Now that would be cool.  Thanks much.  Cheers!
    --
    wjs
  • AlphaKahunaAlphaKahuna Customers, THE valuable asset.
    Smart girl!  Great video...it's playing here in the office right now!

    ZapperGirl
    http://sexy-technology-geeks.blogspot.com/

  • keeronkeeron Obsessive Geek

    Very cool! Had seen several articles on it but this was a really nice way to dive into it and understand it better.

    Wow 4 patent cubes! [looks around his cube and sees a Channel 9 guy.. ah well that'll do for the time being Sad ]

  • LaBombaLaBomba Summer

    Interesting...

    i will definetly be checking this out.Smiley

  • Interesting.  I wonder if LINQ, and therefore BLINQ, becomes less relevant when the database access layer is abstracted away from the ASP.Net front-end application via a SOA (using web services, for example).  I haven't had a chance to look at the LINQ feature set in detail, but it seems that a direct view into a given database is going to become less and less of a common thing to have at design time (for enterprise app development).

    So, while it seems LINQ would be useful to me as a developer if my application was like...

    Browser --> IIS --> .Net App_Code --> Database

    ...the reality is that my applications tend to be more like...

    Browser --> IIS --> .Net App_Code --> Web Service Proxy --> Middle-tier Web Service Endpoint --> Middle-tier Business Logic (Java, C#, whatever) --> Data Abstraction Layer (e.g. Hibernate or other ORM) --> Database.

     Is there a feature of LINQ that would serve a useful purpose in my more abstracted environment?

  • MinhMinh WOOH!  WOOH!
    Editing a customer ID lets you select from a pick-list of customer ID's?

    I'm not sure if that's entirely useful.

    But I'm definitely interested in the Ruby on Rail -ness of it. In addition to the Entity Layer's show yesterday, I like this trend.
  • Ang3lFir3Ang3lFir3 Codito Ergo Sum

    good interview and kewl tech.... My only concern is that some DBA somewhere will get the idea that they are all of a sudden a dev and BLINQ might end up becoming someone's solution to a business problem..... while that sounds great for the DBA's I can see me having a hard time explaining to the customer that after the magic from BLINQ that we aren't done yet....... excellent example tool but i see potential for abusing it.... plus i just watched a console app escentially do my job (ouch)......

    I understand that was not the intention but as devs it's scary to watch automation carry into the things that used to once be the soul domain of devs and architects ..... the stuff that put food on our tables.... Lets just  hope that the intended use is more often the case than the potential miss use......

    As an ASP/ASP.Net dev i'm in the class that still wants a few things to be a mystery to rest of the world where just asking /? doesn't give all the answers....

    hope that didn't all come off too negative, I just would like to know if this is the kind of stuff that gets talked about when things like this become reality?....

  • Joshua RossJoshRoss Drinking Ovaltine since 2004
    Has anyone else used sqlmetal?  I see references in the fourms about it, but not anything offical looking.
  • keeronkeeron Obsessive Geek
    Minh wrote:
    Editing a customer ID lets you select from a pick-list of customer ID's?

    I'm not sure if that's entirely useful.

    But I'm definitely interested in the Ruby on Rail -ness of it. In addition to the Entity Layer's show yesterday, I like this trend.


    I think the page she showed was a details listing and so the record of customers was pulled from the customers (or similar) table. If you were editing a customer for that order, you don't want to be editing the name, rather choose from existing list of customers (You aren't adding a new customer, rather modifying the details for an order). If you were adding a new customer, I am sure there was a similar page to edit/add customers.

    In an ideal world, you would probably have a single page... fix any errors/typos in the customer name (i.e. edit) or add a new one.. but since this was generated based on the database (and that's how you would do this in a database), I think it was correct.
  • rjdohnertrjdohnert You will never know success until you know failure
    Great Video Chazz, very informative and very easy to lose myself in.
  • W3bboW3bbo Work hard; increase production; prevent accidents, and be happy.
    Nifty technology, but I'm still a little uneasy about losing control to this ORM creator, but I'll check it out.

    BTW, are those boxes of breakfast cereal (and a bowl) I see to the right of the monitors?
  • Richard Anthony HeinRichard.Hein Stay on Target
    leadfoot:  LINQ is made to query not just databases, but also XML (think web services) and objects.  So you can certainly try to generate against any source of data, including SOA contracts - but it doesn't do this all for you now.
  • Richard Anthony HeinRichard.Hein Stay on Target
    Angelfire said:
    "I understand that was not the intention but as devs it's scary to watch automation carry into the things that used to once be the soul domain of devs and architects ..... the stuff that put food on our tables.... Lets just  hope that the intended use is more often the case than the potential miss use......"

    :O
    Automation is your friend!


    It's way too late to turn back the hands of time; not to sound so melodramatic, but think about Ruby on Rails and Django, etc..., this is just the next step in web development and vital for .NET developers to compete.

    I have already used BLINQ to generate a large website.  The code is amazingly small and understandable to anyone who knows ASP.NET 2.0 and LINQ.  I have never seen better than BLINQ personally, including Rails. 

    However it is still up to developers to work against that to meet all the business requirements - the pages are far from done is most cases.  That's still a lot of work.  Now you can focus on business programming, instead of technology programming, however.

    I am just waiting for LINQ to be released to use it in earnest.
    Big Smile

  • Ang3lFir3Ang3lFir3 Codito Ergo Sum
    Richard.Hein wrote:
    Angelfire said:
    "I understand that was not the intention but as devs it's scary to watch automation carry into the things that used to once be the soul domain of devs and architects ..... the stuff that put food on our tables.... Lets just  hope that the intended use is more often the case than the potential miss use......"


    Automation is your friend!


    It's way too late to turn back the hands of time; not to sound so melodramatic, but think about Ruby on Rails and Django, etc..., this is just the next step in web development and vital for .NET developers to compete.

    I have already used BLINQ to generate a large website.  The code is amazingly small and understandable to anyone who knows ASP.NET 2.0 and LINQ.  I have never seen better than BLINQ personally, including Rails. 

    However it is still up to developers to work against that to meet all the business requirements - the pages are far from done is most cases.  That's still a lot of work.  Now you can focus on business programming, instead of technology programming, however.

    I am just waiting for LINQ to be released to use it in earnest.




    I agree automation is my friend..... mine and my keyboard's Wink the only real fear is that "automation in the hands of the wrong people leads to terrible things".... I'm not saying i won't be using blinq (tho most likely just sqlmetal instead most of the time).....

    Lets just try and keep it kind of a dev secret.... when was the last time you let your DBA write Business Code (and i happen to prefer tech programming over business programming)....

  • ubercoderubercoder Hakuna Matata
    I'm in love!!!!

    Both with BLINQ and Polita Wink

    I've been looking for something like this to use during development for a while.

    A lot of cool features.

    Good work Polita!!!
  • ubercoder, keeron, AlphaKahuna, and staceyw: Thanks, I'm glad you like it.

    W3bbo: Yes, they're cereal.  Makes for a great afternoon snack. Smiley  Maybe I should have cleaned up a little before Charles came over, in retrospect.

    Ang3lFir3: I hear your concerns, but hopefully great tools will let you focus less of your time on the drudgery of data manipulation and more on your webpage customizations and great new features.  And then maybe you can go home earlier!

    Polita

  • Looks very promising, what I object is that it's still data driven. You generate a new set of classes that abstract a database (which might be usefull), but why generate new classes if you already have your own set of the domain in question? I believe a coherent Model Driven solution should also exist and I guess with entities the true ORM nature should allow us to use our domain objects directly. At this point we can see a convergence between the approaches of both Java and .Net on persistence and object-relational mapping except that .Net integrates the queries directly in the language.
  • I watched this short one and the longer one by Anders on LINQ, and it seems neat to be able to program against objects instead of "select column, column from table where criteria".  It seems really nice to get intellisense for what you're doing.

    However, one problem I can see remains: nobody who is serious about what they're doing is going to be writing ad hoc queries inside their general purpose programming language.  They're going to be calling stored procedures that are already precompiled.  When I watched Anders, while he had his log enabled, I could see the raw SQL that the LINQ object was sending to the SQL server.

    So, my question is this: Are LINQ and BLINQ sending actual SQL queries to the SQL server that cannot be optimized unless they're the exact same query and have already been precompiled?  If so, it seems like there's no way for SQL to have an execution plan ready ahead of time.  How do LINQ and BLINQ address this?
  • cbenard: LINQ and Blinq both support calling stored procedures.  Try passing the /sprocs argument to Blinq and your stored procedures will show up as methods on the DataContext.  You can then alter your static methods to call those sproc methods.

    Polita

  • Most excellent video. Perhaps the rebel elements on this board will finally see the futility of "alternate" systems.

    P.S. Padme?

  • Polita,

    Thanks for the answer about using SPs with LINQ and Blinq.  For clarification though, am I to understand that if you do standard LINQ queries like "from c in .... where .... select...." that it will not be optimized in SQL sql server?  If I'm understanding that correctly, it is simply passing "select ... from ... where..." to SQL server as an ad hoc query if you're not calling SPs.

    Thanks again.
  • Few questions

    1. What are the pre-requisites

    2. Will this need any of the new tools like .Net F/w 3.0, vista,.....

    ANy help appreciated...

  • Few Questions

    1. In EDIT Mode, how do ensure that we can edit only limited fields rather that all the column.  Is that doable?

    2. Where / How do we edit the code, can you add more in-sight on that please

    3. You ran BLINQ from command prompt, that generated some vb/c# code, which I presume is editable. If so, lets say I made edits to these c#/vb code.  Now if I re-run BLINQ from command prompt, will it over-write my chanes?
  • Add some Gift/Award to your "Provide Feedback" feature, then you can expect some real great response, else there will be less participation.

    Speaking based off my experience.

  • prabhupr:
    Please check out the Blinq info page for info on the requirements for running Blinq.

    Once Blinq has run, you can change the generated GridViews and DetailsViews to allow editing on just the columns you choose.  On BoundFields, you can disable editing by setting ReadOnly=true.  On TemplateFields, remove the EditItemTemplate.

    You can edit the data retrieval methods in the StaticMethods file in App_Code.  I would discourage you from making changes to the database code file that's in App_Code.

    Blinq is a one-time website generation tool, which means that successive runs will overwrite, not modify, output from a previous run.  In other words, if you run Blinq again, it will overwrite the contents and your changes will be lost.

    cbenard:
    Yes, if you write standard LINQ queries, sprocs are not called.  Instead, standard SQL commands are created and issued to the SQL Server.  I don't have a deep understanding of whether SQL is able to optimize those queries before or while running them, but the commands themselves are not pre-compiled.

    However, if you have sprocs that you would prefer to call, I encourage you to do so by passing the /sprocs argument and altering your static methods to call those sprocs.

    If you're looking for a more in-depth conversation about LINQ specifically, there's lots of information on the LINQ Project page, including a pointer to the LINQ discussion forum.

    Polita
  • SQL Server does optimize non-sproc queries pretty well. Contrary to what most people think, they are even faster in a number of cases because the server is often able to create a better execution plan depending on the parameters, as opposed to sprocs that have a fixed execution plan, which sometimes negates the effect of not having to compile the query.
    As always when perf is involved, measurement is the only way to find out.
  • flerlerpflerlerp flerlerp
    Check out www.ironspeed.com

    IronSpeed doesn't use LINQ (obviously), but since it's a few years ahead of BLINQ, it should give you a good idea about how cool BLINQ can be in the future.

    One of the very cool things about IronSpeed is that you can regenerate over-and-over as your DB evolves and you don't lose changes you've made to code. BLINQ will def. need this functionality to complete.

    Great video, looking forward to working with BLINQ.
  • schrepfler wrote:
    Looks very promising, what I object is that it's still data driven. You generate a new set of classes that abstract a database (which might be usefull), but why generate new classes if you already have your own set of the domain in question? I believe a coherent Model Driven solution should also exist and I guess with entities the true ORM nature should allow us to use our domain objects directly. At this point we can see a convergence between the approaches of both Java and .Net on persistence and object-relational mapping except that .Net integrates the queries directly in the language.


    Sounds like you need to read the SQL Server manual. Since 7.0 there is no advantage to running a query that is in a stored proc over one that is sent via the connection.

    As a matter of fact there can be a disatvantage in that the first time you run the stored proc, the execution plan is optimized for the specific parameters that you pass in. Your next call to that proc may have a faster execution plan but the existing one will be used since it is from a already run proc.

    Also, dynamic query's execution plans are cached, so if the same query comes in again the previous execution plan is reused.

    You may want to look at some of Kim Tripp's web casts on SQL performance optimization where she actually demonstrates that even using dynamic SQL in an SP can dramatically increase performance.

    BOb

  • Polita, BLINQ is super cool. I plan to start my next project by running BLINQ. I am very lucky to have a very nicely normalized database that I want to build a new ASP.NET based UI around. But I am aware that this is not very often the case. Most databases I have to deal with are out of my control and seem to be full of broken bridges. Will it be possible to run BLINQ over the upcomming ADO.NET Entity Framework to solve this?

    And this is off-topic, but very important (even if it is not as cool as BLINQ). Are we going to see a two column DetailsView someday?
  • Diego- DetailsView is already two-column: one for the field names and one for the field values.  Is that not what you mean?
  • MyGenerationMyGeneration EntitySpaces / MyGeneration
    Have you seen EntitySpaces ASPX Template Suite? It works on all thier DBMS systems.  It makes for a very nice .NET architecture as well.

    http://www.entityspaces.net/portal/Products/ASPNETTemplateDemo/tabid/136/Default.aspx

  • phuff wrote:
    Diego- DetailsView is already two-column: one for the field names and one for the field values.  Is that not what you mean?


    No Polita, sorry for the confusion. What I would need is a new kind of DetailsView control that would look like two of your current DetailsViews placed side by side. That would total four columns, but I guess you could generalize the idea to multi-column DetailsViews.

    In my company we have been building a set of components and practices around ASP.NET 2.0 to accelerate the development of our own applications.

    We like to use DetailsViews (and also GridViews) because they let us build user interfaces that work with only a few lines of code and very little markup. It is also nice that we don't need to buy third party components for decent user interfaces anymore.

    However, a common complain has been that our DetailsView based pages look too sparse and do not take advantage of horizontal space.

    Every time we have to resort to FormViews we don't like it because they need much more code and markup. It is also more difficult for the UI programmer to get the layout right. 

    Also, we have developed a few DataField controls that work inside DetailsViews and GridViews so we can sometimes avoid using TemplateFields, but we cannot use those controls inside a FormsView.

    If we had a two (four) column DetailsView, we could get rid of FormViews almost completely.

    There are other related issues of course. We cannot use multiple DetailsViews connected to the same DataSource, and at the same time having fields that are contiguous in the user interface but do not directly map to the same underlying DataSource is a common hurdle.

    Thank you for listening.

    PS: I decided to submit this as a piece of feedback to https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=185387 (It is a shame that I cannot edit the original post there, cause it is a senseless mess).

  • samdruksamdruk samdruk
    cbenard wrote:
    Polita,

    Thanks for the answer about using SPs with LINQ and Blinq.  For clarification though, am I to understand that if you do standard LINQ queries like "from c in .... where .... select...." that it will not be optimized in SQL sql server?  If I'm understanding that correctly, it is simply passing "select ... from ... where..." to SQL server as an ad hoc query if you're not calling SPs.

    Thanks again.


    LINQ queries against SQL Server databases do get translated into SQL statements that get sent to the server itself for processing. Of course, SQL Server does optimize those queries like all others; that is you don't have to wrap SQL statements into a stored procedure in order to optimize a query. Stored procedures are good for wrapping up more complex computation than query and view management (updates, especially) of course.
  • I recognize the poster on the wall - the good old ASP.NET Page LifeCycle poster (http://pointerx.net/photos/screenshots/images/852/original.aspx). Smiley
  • Pretty impressive work. Sounds like automatically building a web interface to the tables in the database. The production databases are usually protected from the developers so that changes are not advertently made. I see that this is going to make the job of production control so much more difficult as the same connection string used by the application can be used by the website built using this tool to bypass the rules within the application and modify data in the database.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.