Not much to say around that except that http://launch.yahoo.com is awesome. The new Yahoo Music Beta is pretty sweet, music videos and so on. I’ve had my Yahoo ID since I was in 7th grade so I’ve rated quite a bit of music, and seen them progress. I must say I am impressed with the latest upgrade. It’s like watching MTV with a FF button. You occasionally get interupted by commercials but hey… who cares!? … I have a customized playlist and get to listen to what I want to listen to, if you wanna try to sell me life insurance as part of the experience so be it. Long as that doesn’t get too intrusive I’m good. Ahem… so anyway give it a shot ::
So tonight we got tickets to go to the Relient K and Switchfoot concert. Not only that but we got to meet Switchfoot. I always feel weird about that kinda stuff. “Let’s go meet the band..” They were pretty cool but I wonder if they felt like they were on an episode of the Crocodile Hunter, except they … were the crocodile. “Oh my Gawd boys and girls! Look at this one… It’s a lead singer species!” … Anyway, its weird to be all chummy with someone you just met… not so much for me but for them, cause they got to be hassled by like 30 people lol, myself included. It was kinda funny cause you go behind these curtains, and Hey! there’s five guys. Had to be there I guess lol. The concert was great actually, the acoustics inside the “venue” sucked( it’s an old building ), but the bands ROCKED so it all works out.
At any rate, here is some video from the concert. The clips are kinda short since they were taken with my camera, and the audio sucks but here goes:
Relient K :
[flashvideo filename=othercontent//RKS1.flv /]
[flashvideo filename=othercontent//RKS2.flv /]
Switchfoot:
[flashvideo filename=othercontent//RKS3.flv /]
We also got a pic with the band which was kinda sweet, I don’t really go to many concerts, much less meet the artist.
That’s it for now, I kinda fell off the bandwagon with the reading thing, but I am working on something else at the moment.
On a geeky note, I installed Visual Studio 2008 on Virtual PC ( 2007 ) and it runs remarkably well. I thought it would be slow, but it’s not bad. I may end up buying a WPF book next since the new controls are nice and confusing lol, its very different
If anyone has suggestions about which WPF book to read, post comments. Otherwise I will probably hit up Amazon and just get the one with the best rating. Hehe.
I’ll keep this short and sweet since I have a splitting headache. I want to re-read what I went over last night. I had a few issues during the examples which I will explain later. The cool thing is that security is fairly intuitive with WCF. If I asked you how to implement any kind of security in a web service… well most people would not know.
Anyway, on another note I have been taking this Seven Habits of Effective People class. Yes, a class. It is offered at work. So far I really like it, and I get the book on CD. One thing I can say about my current employer is that they’ve always offered tons of training. If all goes well I’ll have another five days of training this month. Training is rather important, to me anyway, I wouldn’t have thought I would have liked the 7 Habits class but I do. I’ve worked places where training was not as important or provided so I can tell it’s much nicer to know you’re staying up to date. I’m ranting…. point is… train your nerds. They will appreciate it and stay with the company.
Chapter four goes into security and how to implement it at the message and transport level. I am only doing half the chapter today since I stayed late at work and have no desire to stay up late again. Anyway, after a rather nice explanation of what security is on all levels the book also has a short spurt about windows security and authentication.
The next thing explained is transport level security and message level security. Transport level security is ussually done by the operating system. This means that your service will not even see the message if there is a problem. Message level security on the other hand is handled by the service.
The book actually has you work through the examples in reverse order. Message level security is implemented first, and transport level is implemented later. Message level security is kind of cool since a good chunk of the work is done by just changing the binding configuration. The transport level security is implemented by using SSL.
That’s all I got for tonight, I am exhausted.
=
I know this may seem just mean and hurtfull… but if you’ve used Windows ME and can compare it to Vista, you and I both know performance wise they are one and the same. I mean they didn’t even provide us with a Vista 2000 that doesn’t take five hours to load… quite the contrary you now have to verify your copy of Windows every time you click your mouse. Maybe Windows 7 ( Blackcomb or Vienna or whatever ) will be better… and maybe they’ll get the point that people like myself will actually pay for their products and hate to “verify” that I am indeed not a thief every 5 friggin seconds. Obviously there are people running hacked versions of Vista… although I can’t understand why you’d want to go through the trouble…. GRRR!
http://www.msnbc.msn.com/id/21202403/
Oddly enough I have one of those 1 million dollar bills, someone gave it to me for my birthday as a gag gift. I always had grand dreams of going to a local supermarket and messing with the cashier’s head, while someone videotaped it. At first glance it would appear that this guy got in trouble for doing just that. Negatory Batman! This ignorant a-hole actually thought he had stumbled upon 1 million dollars in the form of one bill. I don’t think he will be going to prison for counterfitting, being the he didn’t produce the thing, it’s not on US mint, and so on… He will however be spending some time incarcerated for assault, and destruction of property… I can only hope that register he slammed was worth more than $1,000 so he gets a felony charge that way he can never vote again. Then again… seeing his brilliance he has probably already had a few of them….. I am thinking mullet and an old van, truck, or camaro…. possibly missing teeth. MSNBC didn’t provide a picture, but I think I got it pegged.
The third chapter goes into error handling in WCF. The introduction to the problem is short and sweet. You can always throw a new FaultException when you catch an exception in the service itself. This turns your error into a SOAP exception that your application can catch and hadle. This however is only a generic FaultException.
The thing that is really cool is that you can define strongly typed FaultExceptions. You do so by the DataContract format just like any other type. What makes this different is that you can add an attribute to your method definition in the interface that specifies the type of exception that can be generated. For example:
[DataContract]
public class MyException
{
[DataMember]
public string ErrorMessage;
}
now that you have your strongly typed fault, you can add the attribute to the service contract interface:
[FaultContract(typeof(MyException))]
[OperationContract]
public bool MyOperation(…)
So how does your client application know about these error types? Well when you create your proxy class it creates the new fault types. The book has you create the proxy using “svcutil”, the whole process seemed rather manual to me. I’m not going to describe it because then you wouldn’t need to buy the book now would you? Or you could always google it
The next thing discussed is the “includeExceptionDetailInFaults” setting that can be set for the host of your service. This property specifies whether or not the specific exception details will be passed along to the client. I actually already got to deal with this while trying to figure out what I did wrong in Chapter 2 :0) As you may recall… or scroll down to read it ended up being a DLL issue in the EL.
The last two parts of the book would make someones head spin if they did not take … I forget what class it was exactly… but it talks about how a ServiceHost class is really a finite state machine. It can be in one of many states depending on what is going on. Pretty cool diagram in the book
I am really tired right now so this is not as in depth as the book explains it, and also I don’t want to post their content.
Last but not least they go over how to handle a bad message coming in from a client. Now if you’re used to webservices and limited to working with just .NET that may seem needless. However keep in mind that a Java client could use your service. That’s all I got… Heroes is over and it’s bed time. I got a crapload to do at work.
Chapter 2 is sort of interesting. It goes into how to build a host for your service. “Host for my service??” you say. Yep that’s right, in Chapter 1 we hosted our service within IIS, however Chapter 2 has many many treats for us. We learn how to build a host for our services.
Moving on, I like that the book goes into WPF a bit, and I must say I like WPF so far. I always meant to mess with it but never did. A lot of people I know have and I was even part of a UI SIG, but I never really felt the need to mess around with any of the early BETAs. I think the biggest turnoff was that if you had an older version of the XAML you couldn’t run it in a newer interpreter. It was a while back now, but I had some .8x sample and I was runing a .9x interpreter, and the lack of backward compatability was a huge turnoff. No reason to waste time learning the BETAs when I can wait, get a book and use the real deal.
So back to the book, the author has you manually type in some XAML… which if you like typing is fine, but I am lazy so I just used the designer to do basically the same thing. Something all may not be aware of if you haven’t used WPF is that everything is a container. So a button could contain a button. That being said, if you have a label, I didn’t see a “.Text” property. I did however see a “.Content” property, so that’s where you put the contents of your label, in this case the text. To further confuse people, Textboxes have a “.Text” property. So in that respect we’re back to the old VB6 days of Label.Caption and Textbox.Text… confusion! … well for some anyway. Definetely not consistent. The other thing that will make your head spin is the amount of properties that you can set per control. That is actually nice. There are a lot of things present that you could not do in the past. The only thing to mention there is that a lot of properties are padded with “Is” so IsEnabled = Enabled , IsReadOnly = ReadOnly and so on.
Back to WCF though. Going into the code for the form presents something that always bugged me. Renaming a WinForm is sucky, and it still is even with WPF. You have to manually change a ton of stuff. This ties back to a “we won’t change code” philosophy that Microsoft adopted, but in certain instances it would be nice to ask me and then if I say Yes do the dirty. Maybe in VS2008…
After you build the application to start and stop the WCF service you add the console application you built in chapter 1. They provide it for you in chapter 2, as part of the solutions. I just added what they provided. It was kinda disappointing that I couldn’t get the thing running as of right now. I got the service to start and the client app to start but I was getting a fault in the service. Since the DLL they referenced was their own, I couldn’t change the code to figure out the fault.
So I just added my work from Chapter 1 and removed the reference to their DLL. I am getting a DLL or one of it’s components not found error:
“An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0×80131040) ”
I tried resetting the reference to the EL components but that was a no-go. I changed the Copy Local property but still got the same error. At least I know its someting going down with the EL and not my work in the examples. I may just use my own DB connectivity component and skip the EL since I’ve never had much luck with it. It has a ton of functionality, but it gets an F in the intuitive department. If anyone knows of any books for working with it let me know. It is quite popular and I hate it…. lol.
Anyway, the most important part of this chapter is that you can define different connection points to your service. You don’t have to use HTTP as you did with web services, you can use TCP. The book has you create a TCP endpoint and it has you change the client application to use that endpoint. This is really nice because you are no longer bound to IIS or HTTP.
That being said that is the last part of the chapter. We’ll get to that shortly. The book goes over bindings in WCF. Think of bindings as a collection of properties that describe how the endpoint will work. Correct me if I’m wrong there.
The book tells all about the bindings that are provided by the framework, and you can even write your own. That however is beyond the scope of the book, as the author puts it. I would have liked it if the book went into the individual binding elements a bit more and explained them. It talks about how you can specify if you want to use transactions or security and so on, but never really gives an example of how to edit that. Maybe in the following chapters… I hope.
The last part of the book has you set up your WCF Service to run within a Windows service that you write. I did not want to add a service to this box so I just read that part and didn’t do the exercise. I already know how to create services and the WCF work involved was similar to what was done earlier with the WPF application.
I must say that thus far I really like WCF. There was a lot of thought put into this. I always thought that WCF was just the next version of Web Services and that the two would be very similar. As it turns out WCF is much more than just that, it is a HUGE … I was going to say improovement but it’s not that, it is completely new and different. I like it!
It always seems like there is the side of Microsoft that can pump out stuff like WCF and then there is a naughty side. I like how WCF works and how there are contracts and so on. I wish that the rest of the Dev tools would follow suit. The major thing that scares me is LINQ, it just seems too… free and wreckless. I keep saying that but keep in mind I have not researched it or used it in depth, but it just seems like one of those things that has the potential of being used all over and creating lots and lots of problems. I don’t like things that make it “easier” for just anyone to do this. A certain degree of complexity is needed to keep the ramrods out. This is why I HATE MS Access, it allows people that can barely function themselves write applications for, more often than not, complex business processes. Then someone like myself gets tortured and has to look at the VBA and debug it and puke when I see the code in there. I feel dirty just thinking about it.
Anyway the point is that WCF seems very good thus far. I was kind of scared to go into this chapter thinking “How the heck am I going to write something that will replace IIS?”, but it was really easy. I can think of a lot of uses for the tools that WCF provides, especially where I work. There are lots of platforms, lots of async stuff goes on, and WCF could really help.
The only thing I’ll mention is that there are no exercises at the end of the chapters. They are within the chapters themselves. I may just do a half chapter per day due to that just so that I get enough content for the whole month… that and I have training this coming week for 4 days. Which means I get done with work at 5, come home, have my pre-workout meal, go to the gym, post-workout meal, cook dinner, eat dinner, read book and post. That may put me in the 1AM range, and I like my sleep. I just reset my bio-clock to get tired at 10pm… and wake at like 6. No reason to biff that… I don’t know I’m kind of a Nazi( or stubborn ) about anything I do so I am going to try and stick with full chapters, but we’ll see.
The first chapter introduces WCF and presents why it was created in the first place. It started out with a decent history lesson, but not one that wasn’t usefull. I actually liked the first part of the chapter. I talked about how COM, DCOM, COM+ came around, and how that evolved. It also had a small blurb about XML and XML Schemas and how they work hand in hand. A similar example to the one in the book is:
<Toy>
<Color>Red</Color>
<Material>Plastic</Material>
</Toy>
can be the same as
<Toy Color=”Red” Material=”Plastic” />
So the “contract” that defines which of the two will be used is the XML Schema. The book also provides a “tip” to go to http://www.w3c.org to read more about XML Schemas, that seems dandy but that site is huge and serves HTML and pretty much anything else the World Wide Web Consortium deals with.
Anyway, the book gets down to business and has you set up Data Access Application Blocks for the Enterprise Library. One of the steps is to replace the database name. The book just has you edit the property in the left pane of the screen. However, if you installed the April 2007 version of the Enterprise Library you can just use the elipsis under the Connection String value and you get a nice DB connection popup to select the database. This also tests whether or not you can connect and so on… quite nice. The book has you save the config file you are working to you My Documents folder ( or Documents in Vista ), I chose to create a folder on the C:\ drive and save all my stuff from this book there.
The examples are actually pretty good, they walk you through step by step. Which I really like since I hate just sitting there and reading something and I love getting more hands on. The thing that I am wondering right now is exactly what Microsoft is thinking though. On one hand they are coming out with WCF, and some pretty cool stuff centered around that from what I can see. On the other they seem to be making it easier for numbskulls to code… Pardon the French but I think certain aspects of new technologies being released are not up to par, namely LINQ. I’ve been looking at that a tad, so I only know enough to be dangerous. However, the irresponsible use of variants and lack of “coding contracts” is just bothersome. Anyway, back to the book we go.
With WPF you can implement Data Contracts to define what will be passed to operations. You also need to define a service contract that will define the operations available, much like the WSDL… if I’m wrong feel free to correct me. I’m not a WCF expert, I’m reading through the book
The service contract reminds me of C++ and defining method headers. You aren’t actually implementing the body of the method, you are just providing a list of what you plan on implementing. The service contract is an interface, not a class. One thing that should be noted is that all types within the data or service contract must be serializable.
The rest of the chapter has you work on the implementation of the service contract methods. Then it has you deploy the service. It did so in a rather manual way. First you have to edit the web.config manually, then add the site to IIS. I then remembered I never installed IIS since I just used the development server in 2005 on my laptop. No reason to bother with IIS until I got to the DEV server.
The last thing was to build a client application to use the webservice. The book had you create a console application, however I created a win app. Console apps are fun for hello world applications but I wanted something to click on.
So tonight’s work involved installing the Visual Studio 2005 Extensions .NET Framework 3.0 WCF & WPF which came with the “companion” CD. I decided to get it off the web to get the latest and greatest. I was only able to find the CTP from 2006 for download from Microsoft, after having to make sure “I got the genuine Advantage” …. gag me. I hate Microsoft sometimes. The only thing that did is add 3 more pages I had to mess with to “verify” my copy for the 30 billionth time. Which is why I am writing this from a Mac Book, that just happens to have Vista on it. Yes I feel dirty right now.
At any rate, back to the book. The other thing that was prominent was the extensions for WF for VS2005. I installed that for giggles…. Man the user experience here just sucks. I just had to “Register” to download the next portion needed. The Microsoft Enterprise Library… that was painfull, the registration page title told me I was going to download the January 2006 version while the download page that sent me there was telling me I would get the April 2007 version. For crying out loud! This is why I quit doing this on the side … it is all half assed. I have the sudden urge to give up and go play a board game with my wife, that would provide a de-stress. Seeing junk pushed out from such a large company stresses me out.
Moving on… The last part I have to do since I am running Vista Super Duper Edition, is to set up the Adventure Works database. That actually went incredibly smooth. I expected some SQL errors when attaching the database but things just worked. Amazing…. The one thing I will say is that they have you run the following command:
C:\….\osql -E -S .\SQLEXPRESS -i [sriptname].sql
that is fine if you are using SQLEXPRESS however if you actually went to the 2005 launch ( like I did ) and got the Standard Edition ( /clap Microsoft ) you need to run this :
C:\….\osql -E -S . -i [sriptname].sql
If you are wondering what the . means it just means the local default instance. If you named your instance it would be :
C:\….\osql -E -S .\[YOURINSTANCENAME] -i [sriptname].sql
So… Aside from some major pain in the ass using Microsoft.com, and shady user experience things went well.
I am going to go switch back to OSX, shower , and burn my clothes….tune in tomorrow for a summary of Chapter 1