How-To-Code.com - Programming Tutorials on Flash, Flex, AS3 & 2, .NET, HTML, CSS, JavaScript and Java.
AS3 Singleton Class
Last Updated on Wednesday, 30 December 2009 10:18 Written by Philip Thursday, 17 December 2009 20:54
The Singleton class, coded in AS3, is designed to restrict instantiation of a class to only one object. It's good when you only want one object across the whole of your application. An example could be you load in a load of xml data and you want to store the values of the xml for use throughout the application. In AS3 we can write a Singleton Class in the following way. We use the getInstance() to return the object created.
1 |
package com.howtocode |
AS3 Singleton Class Access
To access a variable from the Singleton class we use the following.
1 |
import com.howtocode.Singleton; |
You can of course do something really cool which is place something like place
1 |
<mx:Button id="flexButton" label="{model.flexData}">
|
into you're MXML and when flexData is changed in your Singleton Class it automatically updates you're MXML as we've set the whole Singleton Class as [bindable].
Interview with Resharper 5.0 Lead Developer
Last Updated on Sunday, 15 November 2009 21:41 Written by Ashley Sunday, 15 November 2009 16:15
For those C# developers who have been living under a rock for the last few years, Resharper is a plug-in for Visual Studio, allowing on-the-fly compilation reporting, static code analysis, refactoring tools, a cool unit test runner and easy code navigation. With the advent of Resharper 5.0 I had a unique opportunity to meet the lead developer responsible for Resharper, and ask a few questions about the new version.
So whats new with this version?
Procedural code to LINQ factorisations
Looks like the Resharper guys have been hard at work conjuring up some new refactorings for Resharper 5, and they have developed some impressive new factorisations to turn procedural code into LINQ expressions. After a brief demonstration it was easy to see that they had put alot of time, thought and effort into these refactorings and the results are pretty good. Developers will have the ability to turn procedural code for querying in-memory collections, XML or Databases into a LINQ expression with one click. In the demonstration i saw, it was able to work wonders on low to medium complexity code, however on more advanced code blocks it didn't seem to suggest any refactorings, but still, i could see this being pretty useful.
limited F# support
One more area of discussion was support for Microsoft's relatively new functional programming language 'F#'. Resharper 5.0 will bring developers *very limited* support for on-the-fly compilation reports and unit testing within an F# development environment. On a personal note I'm glad to see that Jetbrains are looking into supporting F#, as I can see the language being really useful in many mathematics based applications.
Compatibility with VS 2010.
SO it seems as though porting Resharper over from VS 2008 to 2010 was actually a bigger task than expected and after a brief chat it emerged that much of the Resharper 4.5 Winforms UI had to be completely re-written due to the fact that much of the VS 2010 user interface has been ported over to use WPF. This caused a "few head aches" for the Resharper team, and they decided to re-write many of the Resharper specific UI screens in WPF (such as the unit testing sessions, and options windows). Personally, after viewing a few of the new screens i think they have suffered slightly from this transition. Surprisingly the new WPF don't look as clean as the Winforms screens used to, however they are still as usable as they have always been.
Team Enhancements
It looks as though in the future there will be more integration between Jetbrains' continuous integration system 'Team City' and Resharper, however for Resharper 5.0 the Jetbrains guys have improved some of the team functionality by providing simple processes for teams of developers to share Resharper settings and configuration amongst their team.
Performance
The one complaint that most developers have with Resharper is with the performance. If you are running on an older machine, and have code wide solution analysis turned on you may aswell give up. Unfortunately there has not been any significant work done by the Resharper team to improve performance within the new release, however this "may be fixed in a future release or patch version."
Conclusion
Resharper 5.0 will be a must have for C# developers who are currently using 4.5 within VS 2008 and wish to upgrade to 2010, and with some of the new features it looks set to be a hit once again. The only negative points are to do with performance, although if you look at the functionality and complexity of what Resharper is doing behind the scenes you can understand why it can sometimes take up system resources.
for more information visit: http://www.jetbrains.com/resharper/
‘WPF Control Development Unleashed’ book on Safari books!
Last Updated on Sunday, 15 November 2009 15:26 Written by Ashley Saturday, 14 November 2009 19:20
WPF Control Development Unleashed by Pavan Podila and Kevin Hoffman is finally available on Safari Books Online!
I’m hoping that this book does what it says on the tin, and provide us with some good examples of real-world, scalable and robust WPF applications..
Flex 3 Component Explorer
Contact : This e-mail address is being protected from spambots. You need JavaScript enabled to view it
The Flex 3 Component Explorer is a good way to browse through Flex 3 Components. http://examples.adobe.com/flex3/componentexplorer/explorer.html
If you're looking at this you might be interested in looking at Tour de Flex as well! Which is another component based explorer apart from with 3rd party components that are amazing!
Page 1 of 3