Serialization And Deserialization with Extensions

Have you played with extensions? Recently I had the task of doing some serialization and deserialization of some objects except I did not want it to be open to all objects. I wanted to limit it down to only objects that implemented a certain interface. Let's check out the code below. Extensions start with a signiture simliar to how we do parameters however the different by using the "this" keyword. This means that only objects that implement this interface, "IEntityBase" can use this extension. Serializing objects allows me to do a couple of things. First, to pass messages where I can control the format of XML, it is already done for me. Second, it allows me to persist the information form non .Net code through some process, and then deserialize so I can do more processing through code. The need for the below code originated with handling messages through service broker. Since the messages are XML and I have control of the format, this was an easy way to pass the objects. "Well cool Bayer, but what about complexed objects"? Taken care of! It handles them too!

Now I can write code like this...

The XML produced from the above code will look like this

<WebGoLive xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TriggeredFrom>NotSupplied</TriggeredFrom>
  <ProductID>000155</ProductID>
  <GoLiveDate>2008-12-22T10:57:21.7362381-05:00</GoLiveDate>
</WebGoLive>

Cool, so how do I get back the object? Well this code is a little more generalized since I need the "type" of object to deserialize. No need to wrap into an extension, but there are no limitations. Here is the code

So putting it all to together will look like this

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/22/2008 at 3:36 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (15) | Post RSSRSS comment feed

Stay True To Microsoft Mobile

A couple of months ago my wife wanted a new phone. Regardless as to what her friends said about the IPhone I had a hard time as a Microsoft MVP justifying the purchase. I wanted to find her a phone which ran the latest Windows Mobile, still could do what she needed which really is not too much but at the same time make her feel good about having a high tech phone. We decided to go with AT&T's Tilt. I checked it out, took off the AT&T Navigator and put on Microsoft's Live Search. She was impressed as was I because I had never seen it work with the GPS.

Well this month it was my turn! I too needed a new phone and was not sure what to get, however I did know that while my other Microsoft MVP buddies were running around with Iphones to there favorite coffee shops, I was going to be different, however I wanted the same features such as touch scrolling, etc...Then I saw it.. AT&T's Fuze! After a couple of minutes I was in love. It had the same features I wanted and then some. As a developer, I can also write cool MS apps to test on the device. Recently I have seen mobile sessions at PASS and Jeff Barnes, who show very quickly how to write powerful GPS applications. If you also are in the market for a new phone, check out the HTC phones. Sprint calls it the Diamond and AT&T the Fuse. There are two models, one is the Pro. It comes with a memory expansion and slide out keyboard, and even with my stubby fingers I can still type on it... Smooth Celling! 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/22/2008 at 3:09 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (51) | Post RSSRSS comment feed

"Tech Talk", Let's Talk Technically About Windows Workflow Foundation

I came across a blog posting that a buddy pointed out to me at the beginning of the month. I found it interesting since I speak a lot about "Why Workflow", however as I read the misunderstandings of what WF really represented through the posting, I quickly came to the conclusion that the author had very little experience with the framework. Now that I have some time to post, I want to answer a couple of key points that Tech Talk's post points out.

1. Let's discuss WF4.0..."Tech Talk" is right. At PDC Microsoft announced that WF4.0 would be rewritten however what does that mean? Well concepts will stay the same. Maybe the way we implement them might change, but we still get all of the rich features which gravitates guys like me to WF...Process visibility, tracking, persistence and so on. In fact, when I heard WF would be rewritten I was confused because this meant everything I had learned was in vain! No!!! I learned a new style of developing and modeling business processes. Learning what is involved with WF is the hard part, wiring things up is easier, infact Microsoft says that they are going to make building workflows even easier. So what does this mean for the applications that I have already written in WF3/3.5? Well I might not be able to extend current workflows using WF4.0, but if I think of workflows as being implemented as services, then autonomously I should still be able to interact with them.

2. What's Microsoft's strategy for WF? No surprise there! Build a framework that can be leveraged internally for building business process solutions while at the same time mainstreaming the framework within products so developers can take development to the next level. Try implementing business processes within SharePoint before WSS 2007. I have seen companies throw plenty of money at this process. But if you look at the possibilities of creating workflows in WSS 2007, possibilities are less endless. Reading between the lines, it is clear where WF falls with the future of development, and if I am not given a strategy on how to implement, which there are plenty of examples, I can still fall on the current tools laid in front of me and figure things out. As Microsoft continues to create new software, I think we will continue to see it powered more and more with WF! Comparing WF, "WF for WSS" and BizTalk...man, please! They are three different technologies for different scenarios.

3. What is a Workflow?  Program level workflow, technical workflow or interactive workflow...hmmm, well a workflow is a process that is followed. We build workflows with code everyday so since we are talking about technology and we build business processes that introduce systematic with human events in order to process I think it is safe to conclude that whether it is a program level, technical, or interactive that they can all cross pollinate and essentially be the same. I do not want to put barriers on what a workflow can do.

4. Where do you store business logic? I love choices...maybe I have business logic already written that I want to let the workflow use. If so, I have a choice. I can call that logic through CallExternalMethod Activities, however I can also add these classes to the project or even add reusable code to custom activities.

5. When do I use a Sequential workflow over state machines? Easiest question at of them all...Who or what is driving the workflow? If the workflow is systematic and data and events are predetermined, I would go with a Sequential Workflow. Now we humans like to change our mind time and time again. If we need a workflow that not only flows down, but can flow up or can have the same state more than once then your best bet is a State Machine Workflow.

6. What is WF aimed at? The "Dudley Do Right" answer is, "To give transparency to long running business processes". What does this mean? Well if there is a process that you need to handle using machines (computers) and/or humans and you want to visually see what that process is because you believe in modeling your process, but more important this process can run for long periods (hours, days, months, etc.) and you want to build this process rapidly to consider the long process, meaning you need rules, a way to track and save process memory through tracking and persistence, then WF is your huckleberry!

7. "Communication concept with workflows is a mess" Not really, parameters are passed into a workflow when an instance is created and events can be fired using HandleExternalEvent Activities while a workflow is running.

8. "Interactive workflow with just 4 states things were getting messy." Curious what it would have looked in Visio or even on paper. I guess if things get to big, just reduce the magnification or fonts or somethingLaughing

9. "Workflow controller is unbearable slow" Ok, well you hit on something...maybe it could be faster. WF4.0 will address performance, but actually the solutions I have in production are working just fine. It's like buying a 27 foot boat, a 30 footer would be better!

10. "the workflow designer shipped with Visual Studio 2008 was ***unusable*** before service pack 1"....What? Come on man!

11. "If you want to user persistence or tracking you end up rebuilding the database frequently" Just remove the data...Of course, make sure you are in a dev environment

12.  "The WCF-WF integration example published by Microsoft definitely belongs into the Hall of Shame" Not sure what to say here...just somewhat confused, never had a problem with the examples on MSDN. It is a calculator man! LOLTongue out

13. Cause 13 is just evil! 

14. Finally..."Software definitely needs to get to the point where my business process reflects in software. There and only there I benefit from workflow driven development." Welcome to WF...you can do this now and you do not have to wait for WF4.0. However I am looking forward to what the team is up to next. I will not say that things are always peachy with WF, however there are things that I can deal with while the framework is being perfected. WF is a young framework so we are going to see bugs/issues, however let's be very clear and honest about using it. Please feel free to contact me if you ever need assistance with something you are stuck on or even general advice! Look forward to hearing from ya!

 

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/18/2008 at 8:42 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (182) | Post RSSRSS comment feed

Racap At Orlando's MDC

As I walk into the speaker room, I realize I do not have my phone. As I backtrack to where I walked in to the hotel, I realize that my phone is gone. Well that did not hold me back from having fun at MDC! I co-presented two sessions, "A Lap around Live Mesh And Live Framework and "Developing Applications Using Sql Server Data Services". One I did with Microsoft's Dan Waters and the other with Microsoft's Joe Healy. Both drew great crowds and I had fun meeting new people and as well as the honor of speaking with those guys. The next stop for MDC is Atlanta, on December 16th, 2008. If you missed Orlando's show, swing up to "Hotlanta" and check it out.

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/13/2008 at 9:45 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (25) | Post RSSRSS comment feed

What Is The Future Of "LINQ To SQL"?

While sharing my passion for "LINQ To SQL" my buddy Joe Healy shared a link with me from the ADO.Net Team Blog that was quite interesting, From now own I will be focusing on using the Entity Framework instead of LINQ To SQL for data store interaction. These are the templates with extension .edmx that came with SP1 for Visual Studio 2008. The big perk is for the change is the feature that is coming here in the near future with SQL DataServices of being able to expose the same stuff I build as a DAL Layer now as a service later within The Cloud

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/7/2008 at 9:01 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (109) | Post RSSRSS comment feed

Tiki In Winter, Only At JAXDUG

Thats right, it will be very tropical at this Wednesday's JaxDUG meeting! We are hosting The Tiki Tiki boys who will be showing off some cool stuff. Register here

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/1/2008 at 2:38 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (33) | Post RSSRSS comment feed

Speaking at Tampa Code Camp 2008 This Saturday

Well it was official late last week, however with Thanksgiving and all I am just now getting to blogging it. Tampa, Florida is having it's code camp this Saturday! I am doing a session titled, "Why Workflow" and if you saw it last time in Jacksonville, Fl. you still might want to come if you are interested in the topic. Most people that come to my sessions know that I really never do the same demos twice. Even though the title might stay the same I always find something new to show off. Since it is the year end of code camps I anticipate to really end it with a bang. Yeah that could mean that I might have some demos blowing up or that also could mean that I plan to really go all out and show some exciting stuff... You don't want to miss it, register here!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/1/2008 at 2:30 AM
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed