Showing posts with label DevTeach. Show all posts
Showing posts with label DevTeach. Show all posts

Wednesday, December 10, 2008

Silverlight 2 Performance Best Practices

Here is some more 'content' summary info from my Architectural Best Practices presentation at DevTeach.

As to performance best practices… use the following as a good starting place:

· Don’t stretch things including Images, videos, or paths. Stretching things is going to cause more processing. Create assets at the size that they will be used and life will be much easier.


· Don’t use ECMA Script or the Anti-Pattern Silverlight 1.0.


· Don’t use windowless mode.


· Remove event handlers and set them to null before removing the element from the visual tree.


· Set MediaElement sources to null before removing them from the tree.


· Don’t use opacity if you just need to make things disappear, instead use the visibility property.


· Do use ‘IsHitTest’ and set it to false when doing drag and drop do hit testing only happens on the elements that are drag targets. This also allows you to keep visual elements from interfering with role over related events such as Mouse Enter and Mouse Exit events.


· Don’t have 1000 thousand elements in the same Visual Tree…


· If something is going to take a while tell the user or show the user that we are waiting.


· Don’t use ‘findName’ if you don’t have too as this causes a walk through the visual tree.


At least following these rules for Architecture and Performance your application won’t fall on its face.

Tuesday, December 9, 2008

Architectural Best Practices for Silverlight 2.0

these will or could change when people that are smarter then me publish material I'm sure but in my work on everything from the emmy site for the SL 1.0, lauch or Crossfader for the BG keynote, or innovate on or msn or the mix 08 stuff etc this all seems to be a nice bulleted list of best practices for Silverlight 2. we will see what happens when there is a Silverlight 3.o so with much ado:

Underlying Silverlight architecture helps us abstracted UI from logic and we need to take into account this toolability story that Silverlight enables as this can provide more ROI and shorter time to market for application development if designers and developers can work at the same time without the whole ‘through it over the fence’ approach. From a design pattern standpoint I recommend pMVP or Proxy Model View Presenter as the ‘better’ design patterns I know of require more upfront development as Silverlight doesn’t support the underlying infrastructure for these patterns. pMVP keeps it simple and the simplest solution is usually the best.
For Architectural best practices lets bullet out our best practices:

· Design Pattern pMVP (Proxy Model View Presenter) which is a clean, simple design pattern to implement that gives better abstraction.

· Make use of designer developer workflow enabled by Xaml UI separation.

· Don’t impose artificial Xaml coding conventions on designers or yourself as this slows productivity. Just let Blend go with it.

· Agree on Naming conventions, coding conventions (maybe standard WPF conventions might be a good place to start) and the like as you like but be consistent so that it is easier to support and pick up again later. This improves readability and helps the whole designer developer interaction.

· For the most part doing event bindings in Xaml, the more in Xaml the better however use common sense. If the designers are using Photoshop and converting the Xaml maybe just do the bindings in code so that you can have the designer just do a new conversion to generate new Xaml if they might make changes.

· Build at lest the Presenter logic in a separate Silverlight library.

· Build generic custom controls in a library.

· Consider putting the presenter code in a separate library or at least its own folder.

· Build Views with Blendablity in mind. Break up complex user controls that build the View into its component parts so that the elements can be more easily worked with in Blend.

· Use Gobal Styles and Templates and other resources in the App.xaml only when they are truly global in the application. Don’t clutter up the global resources with elements that are not really global.

· Use best practices with other connected technologies such as WCF or SQL or IIS/ASP.NET. Best practices in Silverlight wont’ do you much good if everything else is a mess.

· IF you build controls that rely on the DOM bridge encapsulate the ECMA related resources either in a Xap or right into the control so the ‘user’ as the simplest method to use the control.

· Consider the install experience to encourage users to install Silverlight so they can use your Silverlight application. Just using the default badge is boring.

· Consider Search Engine Optimization if it is a public site, such as control element names and the HTML on the Silverlight page etc. event the names of Xaml elements as a lot of this will be in the Xap that will at some point be parsed by search engine spiders.

That gives us a nice list of best architectural best practices. Following these simple rules lets you approach Silverlight architecture and application design with ease. Now we didn’t go into a lot of the application ‘Design’ aspects of ‘Designing’ applications such as UML etc but the focus here is strictly on Silverlight.

Monday, December 8, 2008

DevTeach Conference Content - Best Practices, Hacking Silverlight, Controls

Last week I traveled to Montreal Canada for DevTeach 08. It was a great conference. not as big as MIX but alot more 'cozy' with great content and lots of cool people. I had the chance to hang out with lots of poeple that were smarter then me such as Dave Cambell and a few guys from INETA and Microsoft. The trip there was a bit of a 'challenge'. Granted my flight out of seattle was delayed once but coming out of Chicago... I swear I heard every single excuse in the book including the airplane didn't have enough air and we had to wait to take off until we could get enough air...

enough air???

Anyway ignoring that little episode it was great. Here are the links to session material and content (mosting slide decks and sample code and some talk track notes I used to memorize content)

http://www.hackingsilverlight.net/samples/SLV421.SLArchitecture.zip
http://www.hackingsilverlight.net/samples/SLV467.SilverlightControls.zip
http://www.hackingsilverlight.net/samples/SLV469.HackingSilverlight.zip

Monday, November 24, 2008

Silverlight 2 Event bindings

So in the process of working on this presentation for dev teach and the article and the book I got in a long discussion with alot of the ubber guys I work with around event binding in Silverlight. In that spirit I would like to get everyones input or at least some ones on what they think about where event bindings should take place....

checkout my post on dotnetslackers and let me know:

http://dotnetslackers.com/Community/forums/silverlight-architectural-best-pratices/t/2609.aspx

Monday, November 17, 2008

CodeMash and DevTeach

Hm... I'm thinking I need to get my outline finished today for DevTeach. I'm exicted about both of these conferences. DevTeach I'm doing 3 sessions as planned but I found out today that I'm also doing a session at CodeMash this year.

DevTeach is giving a bunch of cool stuff to attendee's and I'm planning on having lots of swag to give out too. Now also at Codemash I get todo the same thing. Codemash is in Ohio at this cool resort and I'm doing a presentation on Silverlight 2 Arctectural Best Practices which will probably include some great 'Anti-Patterns' with the ubber Silverlight app Crossfader. If you can come check it out. :)

http://www.codemash.org/

and of

http://www.devteach.com/

both awesome conferences. :)

Tuesday, November 4, 2008

Seattle Code Camp

In a couple weeks there is the Seattle Code Camp in Redmond that I'll be presenting the first versions of the sessions I'm doing at devteach. Early Sunday is the best day for code camp of course as I'm presenting 3 sessions straight with lunch in the middle.

https://seattle.codecamp.us/sessions.aspx#HACKING+SILVERLIGHT+2+

Come check it out and help me get ready for DevTeach.

Friday, August 15, 2008

Dev Teach 2008 Toronto Canada

I'm doing at least 3 sessions at DevTeach Dec 1-5th in Toronto Canada so far the 3 sessions I'm doing are:

Building Silverlight Controls
David J Kelley - SLV467
Designed primarily for Developers. This technical presentation walks through a number of senerios for building Silverlight Controls including user controls and custom panels. The usage of properties, dependency properties, events, reusability, and encapsulated control architecture is reviewed in detail. In the presentation we will build a custom chart control based on a user control and built custom panels and review dispatch timer and multi threading in the context of controls.

Hacking Silverlight 2 - For Designers and Developers
David J Kelley - SLV469
Designed for Designers and Developers. This engaging presentation gets the audience involved in bridging the gap between design teams and software development using Silverlight and the Silverlight toolablity story. The presentation is full of audience participation and skits that get audience members up out of their seats and excited about Silverlight. The basics of team work using Microsoft tools for design and development are used and the audience is shown some of the coolest Silverlight hacks that can make Silverlight applications really shine. With the “Coming out of the closet” skit the audience is shown sexy UI using Silverlight, learning about speed of development and why we care about Sexy engaging Web 2.0 experiences.

SilverLight 2.0 Achitectural Best Practices
David J Kelley - SLV421
Designed Developers and Architects or people wanting to understand Silverlight archtecture. This presentation startings with a detailed technical review of Silverlight control, application architecture and design patterns. Design patterns as applied to Silverlight application development and general best practices are reviewed in detail. The presentation includes learning from the trenchs of building Silverlight apps on a large scale including horror stories and ‘Anti-Patterns’ or things ‘not to do’ are reviewed.

check out http://www.devteach.com/Session.aspx for more information