 Monday, May 23, 2005
Pat Piccolo has posted some of his photos from Code Camp online. Check them out here.
— Matt Ranlett
posted with BlogJet
 Sunday, May 22, 2005
I made it to the Developer Expo this past Friday ( I took the day off work – burned a VACATION DAY for it, but it turned out to be worthwhile )
Kirk Evans gave us a preview of the new Visual Studio Team Services as part of the keynote. I’ve actually heard about this stuff before, so I’ll just link you to more information about it rather than going into detail in this entry: VSTS
Structured a lot like Code Camp, there were three tracks with five total breakout sessions. I’ll tell you about the ones I went to.
Service Orientation per Kirk Allen Evans:
Connected Systems are not all about communications – it’s about bringing your applications to new life. It’s about “increasing revenue and reducing costs” – Kirk’s most repeated quote. The list of advantages to connected systems and the challenges look like the same list; info worker productivity, business agility, value chain integration, end to end security and trust, seamless access to information. Basically, with connected systems, once you figure out how to get past the challenges, they become advantages in making your enterprise more adaptable and faster than your competition.
The problem with connected systems – getting data from point A to B to C with context.
Attempts thus far.
-
REST: representational state transfer – recently hyped as web services by Yahoo, Amazon, and others. REST = POX (plain old XML) bound to HTTP. REST sounds like SOAP without the envelope – deliver an XML packet and use HTTP verbs to decide what to do with the XML.
- EAI – application integration through a central system. High licensing cost, complexity, vendor lock in , scalability (single point of failure)
- ESB – Enterprise Services Bus – many interconnected central points. Architecture or SKU(product). Programming model silos, slow to adopt WS-*. MS answers with BizTalk and CSF (Common Services Framework) today, BizTalk and Indigo in the future.
SOA – another step on the path to the solution. SOA is yet another attempt at effective distributed programming (DCOM). DCOM was too tightly coupled (you had to share types, languages, and ports) to work well. SOA decouples and only cares about the contract (how to format) and the message (the payload). We’re driving to connected systems (HST architecture). To do that, use the WS-* architecture. The messaging is based on SOAP b/c everyone can speak it. Security, Reliable Messaging, and Transactions are provided by WS-* extensions. BizTalk is an implementation of the WS-* specs. Indigo is a better implementation of the WS-* specs. It allows for secure, reliable, transactioned messages in three lines of code (as opposed to 27000 lines of code required with WSE 2.0 or 56000 lines of code prior to WSE). XMLSchema is the canonical schema – the authoritative, common definition. The schema doesn’t change. XML Schema is not actually a single schema – it’s a big bucket of lots of different schemas. Use the schema to fix the contracts surrounding the use of web services.
FYI – I really had a blast watching Kirk present – he’s a natural, standing up in front of the group trying to restrain himself from craziness like flicking everyone off as he gets wrapped into his own stories. He’s a great presenter – the best I saw all day.
Richard Weeks from Avanade presents the Enterprise Library:
The Enterprise Library wraps several of the PAP application blocks (Data, Config, Crypto, Security, Exception, Logging, etc). The goal of the enterprise library is to simplify the use of these blocks. For example, the extremely slick Configuration tool (add to the Tools menu by customizing the menu) will create all the XML in the App.config file based on a user friendly GUI as opposed to writing the XML on hand. The Database block allows you to connect to a DB, execute a stored proc, and bind the results to a grid in three lines of code. The logging component makes logging so easy it’s almost hard to believe. One line of code – Logger.Write(“text here”) – that’s it! Based on the config, we were logging to two places at the same time with independently configurable levels of detail. The exception component allows “exception policies” to be defined and log, wrapping an exception with another exception, replacing an exception with another, or create your own action. The exception policy tool was really sweet – complete with a list of potential exceptions (reflection, anyone?) you can select from. Dan and I both enjoyed this presentation – it looks like something really useful.
Kevin Heldt from Internosis Inc walked us through the development platform for SharePoint:
We looked at the Sharepoint Object Model and how to program against it. The first two demos were us creating an entire portal site and then adding documents to that site through a separate Admin tool we created in code. Next we looked at Web Parts and how web parts can be used to provide ASCX type functionality within SharePoint, including creating a Provider – Consumer model to create a data binding relationship between different SharePoint webpart components. Finally we looked at the process to deploy a SharePoint Web Part to a SharePoint site.
Scott Bounds from the Microsoft Communications Sector presented Microsoft Identity and Access Management:
How do you handle all the different logons required for all the different applications, both internal and external to an individual organization? In the past, everything was separate, today we try to integrate and pass security around, in the future we are heading towards federated systems. The MS core foundation for authentication is Active Directory, a central focal point for network and user management. AD Application Mode (AD/AM) for LDAP is for local app data. AD/AM is basically Active Directory but with only LDAP and replication, none of the other authentication stuff AD supports (like the SAM and Kerberos). It runs as a non-OS service. Addins like the Microsoft Identity Integration Server 2003 (MIIS) tie lots of different 3rd party applications like SAP, Sun One and other stuff (non-MS stuff) for user synchronization and provisioning. The goal, as Win2k3 heads towards Service Pack 1, is to reduce the cost of password maintenance. Plus, you can do mapping between identities so you can expose user credentials to extranets and external users. This allows separate companies to authenticate each others users across trusted relationships.
Leslie Sistla from Microsoft gave the presentation on SQL Server 2005:
SQL Server 2005 comes with some new Enterprise Data Management features such as a new isolation level, database snapshots, database mirroring for high availability. Also Developer productivity and business intelligence features. Developers get the ability to integrate with Visual Studio and can use multiple languages. You can write T-SQL for data intensive function and .Net languages for CPU intensive functions and you can seamlessly step cross-language.. You also get a new XML data type. Recursive queries and try/catch exception handling are now supported in SQL Server 2005. SQL2k5 fits into the SOA model by providing direct web service access to SQL Server. Query Notifications enable responsive multi-tier caches. Service Brokers work with distributed messaging and queues. In Reporting Services 2005, the Business Intelligence Management Studio (separate from the Management Studio) will be able to design reports without Visual Studio. Coming in 2005 with SQL Server Visual Studio 2005 is a Local Mode where you can run reports without requiring an IIS server. The expected introduction of SQL 2005 brings with it some significant ADO.Net enhancements. I’ll blog more about that stuff later.
There was a lot of good information packed into these sessions. I’d have loved to make it to 3 or 4 of the discussions I couldn’t attend. At some point the content will be placed online. I’ll post links to it when I get it.
— Matt Ranlett
posted with BlogJet
A while back, a post on the Atlanta .Net Regular Guys site and a post on the Cerebral Kitchen site explored Digital Rights management and the iffy use of technology to protect IP or intellectual property. (Here is the original post, but all comments have been lost during the transition from .Text to DasBlog). The end result of the conversation seemed to be that everyone agreed IP requires protection but current technical implementations of digital rights management software are either completely ineffective or way to restrictive. I just found this article where Microsoft Research seems to agree that the illegal spread of digital content is unlikely to stop, especially since it’s so easy to find what you want on the darknet – the collection of networks and other technologies that enable people to illegally share copyrighted digital files with little or no fear of detection.
— Matt Ranlett
posted with BlogJet
 Saturday, May 21, 2005
If you have not seen Glen Gordon present you are really missing out. Every time I see one of his MSDN Events they are always better than the one before it. This time the parking lot was full because right after the MSDN event Star Wars 3 was showing. Glen really showed his love for Star Wars when he got there at 7 something AM to protect his space runner from being over taken. This was a very interesting MSDN and the topics were intriguing considering I had just heard the Indigo presentation from David Chappell that morning. The reason I found it intriguing is because the first topic was on Web services and WSE 2.0. Glen did a great job of showing how to create and consume the services. Next Glen showed us how you can WSE 2.0 for your web services to make them more secure, trace their output, and many other options just by clicking the options from the WSE 2.0 screen. You still ask what was so intriguing about David Chappell with Indigo and WSE 2.0 by Glen. Well it appears that Indigo will only support WSE 3.0 so you will have to rewrite your applications that are WSE 1.0 and WSE 2.0. I wouldn’t think that Microsoft would make an MSDN event focused on pushing these technologies without making the point of best practices for moving forward.
After a short break and the popcorn people running out of popcorn temporarily we headed back into the theater for the next presentation. Glen started out telling us it was SQL 2005 so I was interested in that, but then he showed us so really cool features of SQL 2005 like creating a web service from inside SQL. This was a really cool feature if you just want to expose some data without writing a wrapper class. He also showed us how to use Reporting Services to create a URL that you can call from a browser. Once he had the URL he created an application that called the Reporting Service (SSRS) web service. He used the Render method of the web service and put tiff files of the report in a Winforms application. Really cool idea!
The last topic Glen talked about was Click Once deployment; it had the most amount of questions. It was Click Once deployment. This was a neat feature to see, but nothing really new from the App Updater Block. He showed us how you can easily deploy your project with a few settings for another person to download. You have the option of creating the application to put a Start Menu item in the Start Menu or just running from the web. He changed the background of the main form and downloaded it with the options. To do the coding demos Glen showed off some of the capabilities of Snippets. I really enjoyed the sessions and hope everyone there had a great time. The content was given out in DVD format and so was VS 2005 Beta 2. Check out both of these resources for the code shown and the tools to build them with. See you at the next MSDN Event for ASP.NET 2.0.
— Brendon Schwartz
Posted with BlogJet
So I’m in the office WAY too early. It’s 5:30 AM as I write this while waiting for a database shrink to complete, but I got into the office at 4 AM. As I drove in this morning, I thought about the JOLT Awards given out by Software Development magazine this year. One of their categories is Best General Books – I decided to go ahead and get the category winner, Head First Design Patterns from O’Reilly Press. I’ve been interested in design patterns for a while now, both as a means for learning more about application architecture and as a means of communicating about applications with other developers [Michael Earls wrote a post about this, but I’m apparently not typing the right keywords into the search engines – I can’t find it]. This book is supposed to be an excellent introduction to patterns, with implementations of each pattern and good and a bad manner. All of the comments on Amazon.com are glowing and the book beat out my other choice (which will be my next purchase anyway) for the JOLT Award. Not that I care about the JOLT Awards, but that means at least one person looked at both books and judged this one a better learning tool.
— Matt Ranlett
posted with BlogJet
[note] – it was Wednesday when I wrote this, I just for got to put it online.
 Thursday, May 19, 2005
I use Trillian as an instant messanger tool because it connects to both AIM and MSN Messanger services. One of the neatest features of the new Trillian tool is to identify some words in the IM conversation and look them up in Wikipedia (my favorite starting point for random facts). At least, that's what it says it's doing, but I frequently can't find the definitions Trillian finds when I go looking myself. Anyway, I was mentioning Keith (Rome) in a conversation with someone and Trillian underlined his name as having a Wikipedia entry. Curious, I looked at the list - mostly famous people with Keith as the family name. But it told me to see also Keith numbers.
Man, I love math. I am terrible at understanding and solving math problems, but the more I learn about it, the more I like about it. This page just set off the Geek Alarm - big time. I love this stuff!
FYI - a Keith number is a number who's digits make up a Fibonacci sequence including itself. For example, 197 is a Keith number:
197: 1, 9, 7, , , , , 
-- Matt Ranlett
 Wednesday, May 18, 2005
Richard Conn introduced the Academic Relations Program – where Microsoft attempts to establish a relationship with various universities around the country. Pretty much what this means is discounted Visual Studio and Office licenses for universities and university students. Microsoft has even started to reach into the high schools, with 20 high schools in Atlanta alone participating. If you have a high school student or college student interested in the computer sciences, Microsoft offers some excellent internships and scholarships. Another interesting facet of the ARM program is its tie to Microsoft Research and a curriculum available to all for teaching Microsoft technologies.
David Chappell introduced himself by making sure that everyone knew he isn’t Dave Chappelle. Nor is he Dave Chappell from Sonic Software (who ironically also writes books and give technical presentations on enterprise messaging). After some fun at his own expense, David jumped into his presentation by postulating that there is always some kind of application architecture for enterprise systems. This started with mainframes, moved on to client/server systems, and then on to multi-tiered architectures. We may now be on the verge of shifting into the fourth evolution of enterprise systems, service-oriented architecture. The reason this shift is possible now and not before is due to the global vendor agreement on how to consume web services. Service-oriented business logic needs to rest on a foundation that is standard and ubiquitous. On Windows, this platform will be Indigo.
In the simplest sense, Indigo is a bunch of C# classes that extend the .Net framework with a new namespace. Indigo communicates through SOAP messages, functioning as an über SOAP stack. This unifies existing MS technologies (ASMX, .NET Remoting, Enterprise Services, WSE, MSMQ) for distributed applications. It also provides interoperability between .Net apps and others (EJB and WebSphere). Finally, Indigo offers the idea of explicitly building service oriented applications.
An important note is that Indigo is not backwards compatible with existing .Net distributed technologies. . Indigo actually implements much of the functionality of the existing technologies, including SOAP over networking channels and many of the WS-* standards. Once Indigo is release, Microsoft will no longer be enhancing the existing technologies. Indigo will not replace the existing technologies, and will not prevent those technologies from working.
Service-Oriented Applications are generally abstracted into Data (relations), Logic (objects), and Presentation (GUIs). Indigo fits into this picture between the logic and presentation and can be thought of as Access to Services. In the past, the link between Data and Logic has been the mapping of tables to object hierarchies and of SQL types to Java/CLR types. When the object-oriented Religion hit the world, OODBMS systems hit the market, only to fail. It turns out that mapping between the relations and objects is easier. Similarly, when the object religion hit the relationship between Logic and Presentation, Microsoft introduce a way to expose object interfaces –> COM and DCOM. That turned out to be very painful. Indigo goes back to the concept of mapping between services.
Having covered the basics of Indigo’s intentions, we now looked at code.
To create an Indigo service, you must implement a service class – the methods the services provides. You must select a host – the app domain and process the service runs in. Finally you must specify one or more endpoints in which to access the services. You have 2 methods for implementing a service class – mark a class with the ServiceContract attribute. Or mark an interface with the ServiceContract attribute then create a class that implements the interface. A caution – Indigo attributes (OperationContract) and C# modifiers (public, private) are completely separate – you can tag a private method with an OperationContract, thus exposing it to applications OUTSIDE the AppDomain. However, that same method is private within the application. David tried to convince us that this is actually a good idea by explaining that you can create a facade of classes which invoke internal methods and expose their methods as services. However, the facade of classes are not supposed to be called from within the application. The group seemed leery of this – much grumbling about a new “method type” was heard. My personal impression is that this seems to be an attempt to encourage good design (i.e. – the Facade pattern) on future projects.
Additional options in Indigo development: One way calls adds a modifier to the OperationContract (IsOneWay=true) for events. Duplex contracts for both the client and service invoking operations in the other. Message contracts allow working directly with the SOAP messages. all data sent and received by operations must be serialized and de-serialized. The way that they are serialized is based on the data contract. To create and pass your own types or enums, you must define a data contract (more attributes).
A quick aside: SVCUTIL can be used to generate a skeleton service class from WSDL contracts if you want to design your interface contracts before writing code, or contract first development. By contrast, writing the code first and adding the ServiceContract and OperationContract attributes as needed is called code first development.
When defining a host, you can host a service in an arbitrary process (exe, NT service and winform/avalon processes) or host a service in IIS or the Windows Activation Service (WAS) – a lite webhost for machines not running IIS. An app or service would use the ServiceHost generic type. IIS/WAS require virtual directories and a .svc file. Just like ASMX, an instance of the service class will be created when a client request arrives.
Finally, you must specify an endpoint – every client connects to a specific endpoint. Every endpoint has 3 things: an address (where to find it), a binding (how to communicate), and a contract (what can it do). Addresses are usually URIs. Bindings wrap together may aspects of communication such as protocols for conveying SOAP messages (HTTP, TCP, etc) security options, support for wS-* specs, and more. Several predefined bindings will ship with Indigo but custom bindings can be created. An example of a predefined binding is BasicProfileBinding which conforms to WS-I Basic Profile 1.0. WS ProfileBinding supports WS-ReliableMessaging, WS-Security, WS-AtomicTransaction, and other WS-* specs. NetProfileTCPBinding sends binary encoded SOAP with support for reliable messaging, security, and transactions directly over TCP (Indigo to Indigo only). One service can expose separate endpoints, each with a different binding for different clients. Contracts are the name of the class that the endpoint exposes (service class or interface). Endpoints are likely to be defined in config files, but they can also be added directly within the code assembly.
To create an Indigo client, create a channel to a service (typically hidden by a proxy which has been created by SVCUTIL or Visual Studio). Clients also specify a specific endpoint that they will communicate with. That’s about it – nothing very complex.
Services built on Indigo can be reliable, secure, transactional, and queued. Indigo also offers reliable messaging; raw SOAP doesn’t guarantee reliable message transfer but some of the Indigo bindings such as WsHttpBinding, support WS-ReliableMessaging. However, WS-ReliableMessaging doesn’t directly support message queuing – this is still an area where the vendors can’t agree on a standard. Since that the world in general and Microsoft in particular has caught the Security Religion, Indigo allows for security configuration via authentication, message integrity, and message confidentiality. Indigo also uses the .Net security model and the PrinciplePermission concepts. Indigo transactions are built on the new 2.0 System.Transactions namespace. Now transactions are separate from state management (different from Enterprise Services, COM+, and MTS). Indigo apps can use System.Transactions explicitly or can use OperationBehavior attributes (which use System.Transactions under the covers). Indigo supports queuing by running on MSMQ as the transport. This means queuing only works on the Windows platform. There are predefined binding choices which wrap queuing.
When considering upgrading to Indigo services, keep in mind that all existing apps will continue to work. However, if you do decide to upgrade, keep in mind the following questions. Will my Indigo app and apps built with existing technologies be interoperable and will my apps be portable? The Indigo team says yes to both questions for ASMX. Remoting will not be interoperable. Enterprise Services interfaces can be wrapped with an Indigo-supplied tool. ES clients will communicate use an Indigo moniker. WSE 1.0 and 2.0 are not interoperable or portable. WSE 3.0 will be interoperable AND portable, but it hasn’t been released yet. MSMQ is interoperable using MsmqIntegrationBinding, but portability is not a simple task.
Indigo vs Biztalk. Indigo is a platform for building services on .Net. Biztalk is an integration tool which maps between various heterogeneous environments. Biztalk already has adapters for technologies like MSMQ and SQL. Expect an Indigo adapter in Biztalk soon.
There is a March CAP currently available for Indigo and we expect the Beta 1 of Indigo in a matter of weeks.
Questions from the audience included:
Indigo talks to a service, what do I get back, a Dataset? Actually you get XML (SOAP), but the data in the message is some kind of serialized object. So it could be Dataset or objects.
What about the rich type support of Remoting? Indigo can serialize any .Net type when talking to other Indigo services. However, when interacting with other environments, use contract first development to ensure data type interoperability
How will Indigo handle big objects like Datasets? Indigo serializes an object sent to it and drops it on the wire.
MSMQ has a max message size, how does Indigo use MSMQ to transmit larger objects? MSMQ is a transport mechanism like TCP – large files are broken up and sent across the wire in discrete chunks.
Does Indigo require full trust to run on a machine like .Net Remoting does? David Chappell wasn’t, but Doug Turnure doesn’t think so. Research is required.
Can you serialize custom types? Yes with a data contract. Alternatively you can drop in your own seralizer.
I ran across this link a while ago in my RSS aggregator and thought I’d post it here as it’s extremely pertinent: Don Box’s Five Minute Indigo Challenge.
— Matt Ranlett
posted with BlogJet
Thanks to the traffic-weighted formulas used by search engines, the Atlanta .Net Regular Guys blog is in the top 3 returns on Yahoo if you search for "guys feeling other guys legs"
Man, that's just odd...
-- Matt Ranlett
I've just upgraded versions of DasBlog, the engine that cranks out this website's blog and RSS feed, and turned on the "Post title as Permalink" option. This means that I will no longer have ugly links with GUIDs and commas in them. Instead I'll get nice, human-readable links. I hope this doesn't break everyone's links to me, but I bet it does. Sorry about that.
-- Matt Ranlett
[Edit] - I just tested and it looks like the DasBlog team made everything backwards compatible - all the external links to the ADNRG blog still link to the correct posts. Great job guys! Just for that, I've contributed $10 to the DasBlog Community edition. I forgot to log in, so my name isn’t on the supporters page. Oh well, I wasn’t donating money for personal recognition.
 Tuesday, May 17, 2005
I just wanted to thank Keith J. Rome for coming up with his book review template and getting me going on doing a review. Check out his reviews of books for great suggestions.
— Brendon Schwartz
Posted with BlogJet
Publisher: Microsoft Press Author(s): Dino Esposito Categories: .NET, ASP.NET 2.0 Published: August 25, 2004 ISBN: 0–735–62024–5 Online Order Links: Amazon, BN.Com, …
Summary:
Going into this book, there are two things you have to remember. The first is that this book was written and published before most of the other books on the subject and is based on Beta 1 material. Maybe Dino will edit this book for a second edition, but everything may not be exactly the same as it was for this release. Secondly, this book is called “Introducing ASP.NET 2.0”, and not “Step by Step ASP.NET 2.0” for a reason. This book shows the differences and enhancements from ASP.NET 1.x to ASP.NET 2.0. If you can remember these two simple facts, you will find the book much more enjoyable. At the time of this writing I was not able to find any corrections to the material in this book. However, I have been told that some of the features written about have been changed from Beta 1 to Beta 2 and the final release when it comes out.
I found this book to be great for learning the new topics of ASP.NET 2.0, but it is not for a beginner just looking to get started with ASP.NET. I did enjoy the fact that there are comparisons of ASP, ASP 1.x and ASP 2.0. This made it much easier for me to know what the differences were and reason behind them. However, the flow of the book is not always easy to follow, and some of the topics are not discussed in-depth very well. In those areas I tended to get lost in what Dino is explaining and I had to reread a couple of sentences. The explanation of the topics and the step by step examples were usually very well written and easy to understand. Dino’s does his best writing when he explains things using examples in this book. The book is well worth the price and time that is involved in reading it. I would recommend this book for anyone that knows about ASP.NET and needs to know the differences and how to use ASP.NET 2.0 components. It is a good book to get you up to date. The writing style in the book is not always as straightforward as it could be, but he gets the points across and makes them easy for you to try out.
I feel the book covered what it set out to cover which is to give developers a head start or introduction into ASP.NET 2.0. Without a doubt, this book covered that and is one of the first books to come to the market about ASP.NET 2.0. I don’t think you can hold it against the book that changes in the software were made between Beta 1 and Beta 2, as this fact is recognized and mentioned in the beginning of the book. This book allows for developers and architects to plan for the future and to know what is coming soon. Dino makes sure to cover topics that have a different approach and methodology than they used to in ASP.NET 1.x so that you can know how you might implement a problem using ASP.NET 2.0. Dino does make sure you understand that in ASP.NET 2.0 there is less code and you use more controls in order to create web applications. In fact, these chapters where he shows the new controls and how to use them are my favorite chapters.
Highlights from this book that I enjoyed most are: MasterPages, WebParts, Rich Web Controls, security logon and the DataSource controls that were covered. These sections alone made the book worth the purchase. He is able to show how a complicated or code heavy web application in ASP.NET 1.x is much simpler in ASP.NET 2.0. Actually, there were not many chapters that I didn’t enjoy reading and that did not give me insightful information to ASP.NET 2.0. If anyone is excited about ASP.NET 2.0 this book should keep you just as excited and get you ready to try out some of the new features in a short time span. Now I would like to see a book by Dino on just the UI part, similar to the one he did for the Datagrid in ASP.NET 1.x “Building Web Solutions with ASP.NET and ADO.NET”.
I felt that the chapters on data access were not very clear and or straightforward. The chapters went on too long for a simple introduction and tried to explain data access in too much detail for an ASP.NET book.
Overall I think that this is a great book for someone that is moving from ASP 1.x to ASP 2.0 and just wants to know what Microsoft is planning and how they are planning on implementing each feature. If this book is not updated to reflect changes to ASP.NET 2.0 as it releases, I think people will start to turn to other books because of the many differences between the release and the beta this book was written from. If you want an in depth look at ASP.NET 2.0 this book will probably not cover everything you want from beginning to end, but it is a great book for the topics I needed as a developer ready to see ASP.NET 2.0.
This book is most useful to:
- web designers / developers that know how to use ASP.NET 1.1 but want to know just the new features of ASP.NET 2.0
- Technical decision makers that need to know what the technology can do
- experienced web developers looking to get a jump on things by learning about ASP.Net 2.0 before it is released
Recommendation:
4 out of 5 stars
If you want a book that covers only ASP.NET 2.0 this is a good book to start with. The size of the book and content that is covered will get you up to speed on the new features of ASP.NET 2.0. This book was written based on Beta 1 so make sure that you realize that some content of the book may have changed.
This book will take you less than a week, and will get you up to speed on ASP.NET 2.0 concepts. You will also see that he compares some of the changes to the way it is done in ASP.NET 1.x or ASP which will help you understand some of the uses of the new features.
-- Brendon Schwartz
Posted with BlogJet
"ASP.NET 2.0 makes it even better by making you more productive, reducing the amount of code you have to write, making your Web sites easier to manage, and improving your Web site's scalability, reliability, and performance." - Dino Esposito
With over 50 new controls for security, navigation, data, and web parts, all of which increase developer productivity and introduce fewer bugs in the design process, ASP.NET 2.0 will make development faster and make the long term cost of ownership less. ASP.NET 2.0 adds some significant enhancements, including an improved and simplified data access process using data sources which includes database caching for better performance of the web sites. Additionally, there is now an option to pre-compile the web site so that users do not experience slow page loads when the system has to compile them. The Microsoft .NET Framework 2.0 makes deploying, configuring, monitoring, and maintaining Web applications easier. Furthermore, Microsoft has created new tools that can help you set up web sites with the correct configuration changes.
Here are some of the quick reasons that ASP.NET 2.0 has improved over 1.x. There are many more reasons depending on the type of sites, but these are the major reasons that I see for asking your employer to move from ASP.NET 1.x to 2.0.
- Compile on the fly; this allows the developer to create an ASPX page and the code page and put them on the server. ASP.NET 2.0 does not make you compile the page ahead of time, so you can make a bug fix and push the file out without having to recompile the entire site.
- Datasource controls will allow for better performance and less bugs due to the data access layer.
- The new improved View State in ASP.NET 2.0 will increase the performance of the time it takes to deliver a page to the end user.
- 100% backwards compatibility, so any page written in 1.x will work in 2.0
- Cross page post backs so you can send information to another page.
- Create caching based on the new SQLdependency which will allow you to monitor the database for changes
- Post-Cache Substitution so that you can cache parts of pages but not the content that changes, which will increase the performance of the web servers
- With Master Pages you can now create one template for an entire site and only have to change information in one place to make a change to every page that uses the Master Page.
- Visual Studio has been enhanced to let you connect to a web site with many protocols now instead of just FrontPage Extensions. Also you can open a single page in VS2005 and have the ability to edit it without opening the entire project
- ASP.NET 2.0 allows for partial classes which will allow you to have business logic in multiple files.
- We can now get information to the page without the user seeing a full postback with a feature called Script Callbacks. This allows the javascript to make a call to the server for more information without refreshing the page.
- You can now SetFocus on an object when the page starts up.
- New controls such as the WizardControl, DynamicImage Control, FileUpload Control, and the GridView control add a great deal of built in functionality that will help prevent bugs.
- Intellisense everywhere has been added to help developers more quickly create and debug applications.
- The new Heath and Monitoring API will allow us to be notified if there are problems on a web page or on a web server.
- The Panel Control is now scroll able, so you can have the web page scroll and not the browser window
— Brendon Schwartz and Matt Ranlett
Posted with BlogJet
Our own local Delta representative, Venkat Polisetti kicked the meeting off with a presentation about web services on the Compact Framework. To begin, we compared synchronous web calls to asynchronous web calls:
Synchronous calls to web services:
- can be dangerous because they have the possibility to freeze your user interface until the call completes in the primary thread.
- can be useful when the web method returns quickly and they are very easy to code.
Asynchronous calls are:
- executed on a different thread
- more complex to code but
- won’t freeze your UI when the web methods are slow to respond.
Consuming a web services on the Compact Framework is pretty much the same as with web and winform apps. When a web reference is added to a project, VS.Net creates a proxy class in the project and creates Begin and End methods for asynchronous operations. Call the Begin method to initiate the web service call and call the End method to complete the web service call. Venkat had prepared a demo for us to help us understand the complexities of using web services and the Compact Framework but his demo misbehaved a bit; the group tried to help out but the problems were initially beyond us. So Venkat took a seat to work on his laptop and gave the floor to Dhamayanthi (D for short). We ran out of time, so Venkat will show off his demo at the next Mobility UG meeting (he did get things working before the end of D’s presentation)
D started her presentation with a quick recap of polymorphism and inheritance. The example she gave was to create a base class with multiple layers of inheritance – ProjectManager inherits from Employee which inherits from Person. She then posed a question to the group, “How do you create the correct object when you don’t know which type of object is required up-front?” The answer is to have the code look up the correct object type and then return to the calling function a reference of type MyAbstractBaseClass. The reference will point to the correctly created object type. This explanation of an Object Factory also encapsulates the concept of dynamic polymorphism. We had spiraled out to a discussion of the Abstract Factory design pattern before D reigned us in and brought us back to dynamic polymorphism with an explanation of how delegates help simplify function calls which have the same signature. She showed us how to use a delegate in C++ before showing us the differences in C#, making sure we all knew our roots.
A delegate in C# is an object-oriented, type safe function pointer. This complicated concept is easily explained by Chris Sell’s article, “.Net Delegates: A C# Bedtime Story”. The story tells of an employee with a mean boss. The employee writes code to notify his boss every time his status changes and the boss is happy. But the next day the boss’s boss wants to be notified of the employee’s status changes. This continues (adding bosses to the list) until the employee is forced to allow any interested party to subscribe to his status change events. To do this, the employee defines an interface that the various bosses will implement (thus inheriting from the employee’s class (Interface Inheritance)). Now anyone who implements the interface can pass their own objects into the interface methods as parameters. This demonstrates polymorphism b/c the functions don’t know ahead of time which objects (bosses) are going to ask for status updates but they are able to take any objects that implement the interface.
The next step in improving the code is to allow the boss objects to implement only the interface methods that they are interested in, not the ones they don’t care about. The other thing we can improve upon is not requiring the use of specific method names. Delegates are interfaces with one method which don’t require interface inheritance. This is good b/c in .Net we are only able to derive from a single base class. By taking each method in an interface and declaring them each as an individual delegate (essentially wrapping the method call in a delegate) the coupling is much looser – improving the flexibility of the code. Delegates are capable of wrapping both instance methods (created when you new up an object) and static methods (which don’t require the creation of an object).
A problem of delegates is that they are public methods and can be directly invoked (skipping the notification feature of the delegate). Another problem of delegates is that a delegate only returns to the last registrant. If multiple people register for the event and they don’t register for an event with +=, then they will erase all the other registrations. To prevent this, wrap the delegates in events. The framework will then create the register and unregister events. If someone then tries to use the event without using += syntax they get a compiler warning. D was on the ball tonight, even breaking out ILDASM to show us what was happening under the covers with delegates and events, and how += completed and -= completed are both overloaded in IL as add_completed and remove_completed (where completed is our delegate name).
The next problem we had to solve was how to get the return value of each delegate or event call when multiple objects (bosses) have registered. The answer is to use the event’s .GetInvocationList method and save the results in a delegate variable. Of course, we don’t want to do this synchronously – we need to make sure we can pass by registrants who aren’t ready to report their results. This is where the BeginInvoke method of a delegate comes into play – you can call the event’s BeginInvoke on the method without passing anything in or retrieving anything out. This is the Fire and Forget method of handling this problem. A better way to handle this problem is to use the IAsynchResult interface and the callback functionality (which takes advantage of the threadpool). The IAsynchResult interface exposes an IsCompleted method which can be used to poll a thread’s status. Once IsCompleted = TRUE, you can call the event’s EndInvoke method. However, EndInvoke is a blocking call so you don’t want to call it unless you’re sure that job is done. The most elegant method of handling the check of return results is to define an AsynchDelegate (type AsynchCallback) to do the checking for you.
A great question was asked by the group – what happens if the event you are calling on a different thread throws an exception? How do you inform your main thread? This question is left as an exercise for the reader! We didn’t have time in the group to really explore the issue.
Positive feedback all around – everyone though the topic was fantastic and that D was a great presenter. In fact, if she ever comes back to Atlanta, we’d love to have her back to present another topic. She told us she’s got a great presentation on design patterns. Maybe I’ll be able to get this presentation from her and let the group work with it on their own time.
Thank you to everyone who showed up and thank you to both Venkat and Dhamayanthi for presenting!
— Matt Ranlett
posted with BlogJet
What’s left in the month of May?
— Matt Ranlett
posted with BlogJet
I filled my car up at the local BP this morning and noticed a sign – buy $15 in gas and get a free 2 liter Pepsi product. I’m always game for free stuff, so I walked away with a 2 liter of Mountain Dew. I don’t know how long the promotion lasts and I don’t know if it’s happening at all BP stations, but you might as well check since you need to buy gas eventually.
— Matt Ranlett
posted with BlogJet
Michael Earls, Brendon Schwartz, and I went out for snacks and beer (mostly beer) after the Mobility UG tonight and sat there chatting until after midnight. While most of the talk hovered around career paths and war stories, one of the topics of conversation might be interesting to the rest of the Atlanta .Net User Group attending public. We were talking about what kinds of topics we wanted to see in the near future. We sat there brainstorming and blurting out ideas. I thought I'd list a few that we mentioned and then open the comments up to the general (blog-reading) public to see what interests the community at large.
Here are a few of the topic ideas we discussed:
- Biztalk - Microsoft is on the verge of releasing Biztalk 2006. Do we all understand the value of Biztalk
|