CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

John Papa [MVP C#]

.NET Code Samples, Data Access, and Other Musings

December 2007 - Posts

  • Accessing Data From a Mobile Application

    I enjoy writing mobile device applications. Especially when I can combine modern architectural patterns that I use in most enterprise applications to mobile devices, as well. My latest article, titled "Accessing Data From a Mobile Application" is now available online in the January MSDN Magazine issue.

    January08Coverlg

    Here is a summary of the article:

    Data access is an important aspect of developing applications with the Microsoft® .NET Compact Framework for Windows Mobile® devices. By using the existing architecture to send and receive data between your mobile application and your application server, you can pass data with either DataSets, custom objects, or scalar values.

    In this installment of DataPoints, I will discuss best practices for data access strategies when developing mobile applications for Smartphones. I will also demonstrate how to design a data-driven Smartphone application that can display and save data over the Internet. I will show you how to communicate with a server application that exposes methods to get data using a DataSet, custom objects, and a generic List<T> of entities.

    Posted Dec 27 2007, 10:26 PM by John Papa with no comments
    Filed under:
  • Getting off My Duff with Graffiti at JohnPapa.net

    As I mentioned previously, I am in the process of redesigning my personal site with all of my articles, presentations, downloads, upcoming events, and other paraphernalia. The move is going well, but due to the holidays I am taking it slow so it will take me some time to get everything up there. Graffiti is making it easy for me to design a nice clean site and host my blog on it. I will be posting some information on the setup and customization tips for Graffiti as I move along.

    In this process I am now cross posting most of my posts to both www.JohnPapa.net and to www.codebetter.com.  Thankfully, Windows Live Writer makes it pretty easy to cross post my posts to both www.codebetter.com and to www.JohnPapa.net. The majority of my posts will still go to both sites, however I intend on putting some content on my personal blog only. Mostly out of ease for myself, items including downloads of code samples, Camtasia videos, slide decks, presentations, and other errata will be over at www.JohnPapa.net only.

    CodeBetter.com is a great community, but this gives me a chance to get off my duff and create my own site and do a little more customization. I hope many of you will come on over and subscribe to my RSS feed as well as the CodeBetter.com main feed.

  • Entity Framework at the Space Coast

    I am setting up my schedule for the first quarter of 2008, and the first .NET user group I will be heading to as an INETA speaker in 2008 is the Space Coast .NET User Group in Melbourne, Florida. I will be presenting an approximately 2 hour long session on the Entity Framework including what it is, why you should care, how it works, and how to use it in practical applications. I enjoy presenting a user groups because the people are usually very interactive. The user group format lends itself well to having good discussions about hot topics since everyone can contribute due to the laid back atmosphere. I hope you can join us and stop by to say hi!

    You can see more information about the event and register for it at this link.

    The date of the event is: 2/20/2008, and we will be meeting from 6:30 PM - 8:30 PM. The "Welcome Time" is 6:15 PM to grab a good seat :-).  Special thanks to Ken Tucker for organizing this and letting me participate.

    Here is the address, or you can click here for a google map link to the event location.

    Space Coast Credit Union Corp Headquarters
    8045 N. Wickham Road
    Melbourne, FL 32940

  • Book Review - LINQ Quickly

    I had a chance this week to breeze through a new book titled LINQ Quickly. It is published by Packt Publishing and written by N. Shateesh Kumar. The book is about 225 pages long and is focuses on how to use LINQ with various  targets. First I will review how the chapters flow then I will give my overall impression of the book.

    The book starts out with a brief  look at what the .NET 3.5 features are in regards to the basis of LINQ. Items such as object initializers, collection initializers, lambda expressions, and expression trees are given a few pages each to explain what they are. This is a nice overview of the features but it does not touch enough on when or where you would or would not want to use these features.

    The book then flows into using LINQ with objects. This is a very short chapter on how to use LINQ with arrays and other list based objects. The following chapters flow through LINQ to XML, LINQ to XSD, LINQ to SQL and LINQ to DataSets. These chapters all focus on how to use LINQ with the technologies, respectively. Its a nice primer on how to do so, but there is very little meat to it.

    The latter chapters are basically a reference for many of the LINQ query expression methods. It gives a nice quick hit list of each method, what it does and an example of how to use it. This is very MSDN like but it is a very nice consolidated list of features with quick examples. For example, this is a nice section or those wanting to know what SelectMany does and how to write the syntax to use it.

    The entire book is a great quickstart or reference but if you are looking for practical applications for LINQ, you will likely be left wanting. I recommend this book to those looking for an easy and fast read that can get you an idea of what LINQ can do and how to write the syntax. It is also good for those more experienced with LINQ who are looking for a quick reference to look up how to use LINQ in certain ways as a refresher. I would not recommend this book to anyone looking for when and where to use LINQ. Also, LINQ to Entities is very absent in this book as there is minimal material on on using LINQ with the Entity Framework.

    I recommend this book to beginners to LINQ those looking for a quick reference on LINQ itself. It works well in that area. If you are looking for more depth, then I suggest looking at some of the other titles out or arriving soon.

    Posted Dec 22 2007, 12:16 AM by John Papa with 4 comment(s)
    Filed under:
  • Moving to Graffiti

    Today I started the migration of my web site at www.johnpapa.net and blog to Telligent's new tool, Graffiti. You can check out the latest news on Graffiti at www.graffiticms.com . It is currently in beta, but has some very interesting features. I am sure to go through some growing pains with it as its full release version is due to come out in January  2008, but so far it has been pretty smooth.

    I took a theme that Rich Mercer created and I tweaked it a bit. He wrote the stylized theme of which I changed some of the styles, images and colors just a wee bit. The result of those change are what you see here on this site.

    There is not a lot of information around on how to customize Graffiti yet, although I expect a lot will be as times moves on. That is the bad news. But the good news is that it is very simple and QUICK to get up and running. I added a few customizations to the site including some static pages in the navigation bar as well. I found a few posts on Rich's site that point out how to do this.

    So now I have to migrate all of my posts from CodeBetter.com over to my site on Graffiti. Jayme Davis has put together a migration tool to do just that. I plan on giving that a try this weekend.

    So please bear with the process. I expect that I will be making a lot of changes over the next month until everything is hooked up and ready to go. I will be cross posting to both CodeBetter.com and johnpapa.net

  • Choosing an API to Talk to the Entity Framework

    Diego Vega started me thinking about the differences between the different API's to the Entity Framework. I am currently doing a lot of writing about the Entity Framework and preparing many sessions on the topic so it obviously interests me :).  I had asked Diego about some of the differences between Entity SQL and using the strongly typed syntax of LINQ. He posted a quick list of some of the differences and similarities in this post today. (Thanks Diego)

    That's a nice hit list of differences. I had not thought about how you can navigate with Entity SQL even without a Navigation property. Going further on this train of thought I figured I would post my interpretation of a similar question I get from people a lot.

    In what situations would I choose 1 over the other?

    The options being:

    1. Entity SQL with Entity Client
    2. Entity SQL with Object Services
    3. LINQ with Object Services

    This is obviously an involved question/answer as the situation has to take into account several factors to make that determination. But overall here is a high level barometer you can use:

    • Entity SQL with Entity Client
      • when you need to read data and not write to it
      • when you need dynamic queries
    • Entity SQL with Object Services
      • when you need to retrieve entities you can interact with and persist, using a dynamic query
    • LINQ with Object Services
      • when you need to retrieve entities you can interact with and persist, using strongly typed syntax

     

    I intentionally left this post very short as a means to help those who are just trying to wade through the deluge of information that is available on the Entity Framework. My general style is to keep blog posts to a quick and easily digestible piece of information. Deep dark details of topics I usually reserve for articles as I know personally when I read a blog post that goes on and on I start to lose focus ... which means I have a short attention span :)

  • Apologies for My Absence at Day of Silverlight

    Yesterday I was supposed to present a session on working with WPF at the Day of Silverlight at Seminole Community College. However, I had to bow out at the last minute due to illness putting the organizers of the event in an awkward position. I want to thank my colleague Jon Goodyear for stepping in for me and handling the presentation.

    I also want to publicly apologize to all of the attendees and to the organizer, Shawn Weisfeld, of the Day Of Silverlight event. While I had to bow out at the last minute due to illness, it does not change the fact that it left many people in an awkward position.

    I owe all of you a presentation at the next .NET Florida Community event. 

    Sorry for the inconvenience and Happy Holidays to all everyone!

More Posts