| Joni 的个人资料Data Matters日志列表 | 帮助 |
|
Data MattersJemm's Personal Blog 2007/8/6 My blog has relocated to blog.jemm.net !I decided to centralize all my postings to blog.jemm.net (rss). I'm not sure what I'll do with this Live Space -blog in the future, but I'll let it exist to avoid breaking links and to preserve the (few) useful posts here are. If you received this through your feed reader, please update your subsription to point to the http://feeds.feedburner.com/Jemm. One advantage of this to you is that should the feed url of my blog ever change again, you don't need to do anything as the FeedBurner points always to the right address. 2007/7/5 Dependency Injection -patternDependency injection -pattern (and a related pattern, Inversion of Control, IoC) helps to make code more maintainable and modular. It can be used for replacing implementation on the fly or add functionality at the runtime. If you aim to make code more loosely coupled or want to make a plugins, then you should be aware of the dependency injection. It helps automated testing, too. Lately I have been building an architecture for an interesting product at work. As it aims to be a major business for a long while, I have to make sure it is easy to test, maintain and expand later as requirements will evolve. The "let's make complete specs first and then code it" -days are over as the more agile methods gradually take over. Loose couplingOne of the main rule I decided was to make sure that the most important layers are loosely coupled. A data access layer (DAL) is a natural example where it is useful. In this project I decided that we'll use the SubSonic as the object-relational mapping tool until final releases of .NET 3.5/LINQ or Entity Framework arrive. While SubSonic creates usable classes, using them directly would tie us to the tool too tightly for years to come. Instead, the goal is to keep our own entities/object model as abstract as possible and separated from actual implementations, like DAL-technologies. It means (with the current proof-of-concept, at least) a little bit more work is required to map classess that the SubSonic creates to own own entities that need to be maintained by hand. However, it reduced lot's of trouble in the future as things can be replaced easily. Another example is an integration layer between our business logic and MS CRM API's. When we abstract the integration layer with loose coupling we are safe, should the underlaying API change or MS CRM be replaced with completely different product. How to implementBefore you can add dependency injection to your application, you should know how interfaces work. Essentially, they define a contract that the classes that inherit the interface must implement. As long as two or more classes share the required interface(s), they can be injected to the class that requires one of them. Once you have the classes that implement the interface, you need to decide what kind of dependency injection you want to use. Do you want to supply the class being injected via constructor or set it through a property after instantiation? Here is an article at DevX by Joydip Kanjilal that discussess this choice. Finally, you need to decide where to store information about the class that should be injected. You can hard code the reference and construction of the dependent classes to the calling code (DI) or add reference to the dependent class dynamically with reflection and configuration file to avoid the need of recompilation (which is really Inversion of Control -pattern). I didn't bother writing code samples this time as all the linked resources have plenty of them to give the idea and a simple search gives even more. Related Resources2007/1/1 Wii rocksI bought us a Nintendo Wii for Christmas as I happened to stumble upon on a pile of Wii consoles in a local store. They are hard to find here in Finland just like everywhere else, so I was a bit surprised and couldn't walk past them... The console comes with the Wii Sports that is one of our most played games with the console. No wonder Time picked it up as the best game of the year 2006! Other games that I obtained were The Legend of Zelda: Twilight Princess and Rayman Raving Rabbids. Wii Play came with an extra controller, but it isn't that interesting, though quite good for introducing the controls for new players. I have already spent several hours with my girlfriend playing with the Wii. Wii like especially the Wii Sports and Rayman Raving Rabbids as they are fun when played together. My girlfriend has always been generally open about computer and console games but we have never before spent together as much time playing something :) The Wii is great, but it won't completely replace my Xbox 360 which is a great console, too. Each console have their own advantages. Wii is great for playing with girlfriend or with friends, but often I want to play the games I have for the Xbox 360. 2006/12/2 New Remote Desktop client for pre-Vista OS'sAs you may know, Vista comes with an updated Remote Desktop client with some new features. I was happy to notice that the updated client is available for previous Windows versions, too. The features include more secure authentication methods, TS Gateway for connecting to computers behind firewalls and NATs, TS Remote Programs for running individual programs over the internet, multimonitor spanning and support for 32-bit colors. Here are the direct links from the Knowledge Base article:
2006/11/7 .NET Framework 3.0, new VSTO, ASP.NET AJAX beta 2...Wow, lot's of great releases from Microsoft! Here are direct links to download pages for the just announced releases: Microsoft .NET Framework 3.0 Redistributable Package Yes, this is the RTM! Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation) RTM! Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP [unsupported] Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System RTM! Visual Studio 2005 extensions for Windows SharePoint Services 3.0, November 2006 CTP [unsupported, for WSS 3.0/MOSS2007 RTM version only!] ASP.NET AJAX Downloads (Beta 2 now available!) From http://msdn.microsoft.com/vstudio/devsolutions/ Add 2007 Office System (client & server), some Vista and a bit of those dev tools and you'll be set! So many great new dev tools, so little time... 2006/8/17 Math support in Office 2007After I read this interesting blog entry by Brian Jones, I got inspired to play around with the new equation tool and more! I'll post my findings here. First, some interesting trivia about math support in Office 2007:
I started playing around with the new equation tool which is cool by itself. Here are some tests: Copying equation as textFirst I tried doing some basic equation and picked a ready-made quadratic formula from the list. Then I copy/pasted it into Notepad and it changed automatically into linear form: Easier to ask help from someone via e-mail, for example: "Please, can you help me with this equation: e^x=1+x/1!+x^2/2!+x^3/3!+⋯,-∞<x<∞" Copying MathMLBrian's blog mentioned that you can copy and paste MathML and it gets translated automatically. I found a site MathML Central and there was a page that allows generating sample MathML. For example, if you copy the following MathML to the Word 2007 (beta2): <math xmlns='http://www.w3.org/1998/Math/MathML'> It's automatically translated to: sin (x^2) Of course, that was quite simple example, but most other tests worked fine, too. Some matrix didn't seem to translate, though. I don't really need equations that often if ever. Anyway, the new math support is just one example of the enthusiasm and attention to the detail that the Office team has put into the next version. 2006/8/16 Windows Live WriterDon't you hate these posts where everyone announces release of a new blogging tool and then tell that the posting is actually written with the specific tool? Ok, enough of ranting. Microsoft recently released the Windows Live Writer beta which is a new free wysiwyg blogging tool for Windows. You can download it from here (requires .NET 2.0 runtime). Go ahead and try it, it is cool! Currently this is a bit better tool for blogging than Word 2007 as you can attach images easily without FTP, there is integrated mapping tools and plugin-support. This blogging tool has also spell-checking! Notice anything funny? :D Oh, I almost forgot to mention: This post was written with Windows Live Writer! Ok, ok... I am guilty of the practice I ranted about in the beginning of the post so sue me! :P 2006/8/1 Great Star Wars -parodyThis fan-made video where Darth Vader shows his meanest side makes me always laugh
Update: Spaces doesn't seem to allow embedding of the [YouTube]-videos 2006/7/28 Using Office 2007 for web page graphicsOffice 2007 has very powerful tools for creating and editing graphics. They are powerful enough for doing visually appealing graphics for web pages! Even though I prefer simple web pages with minimum amount of graphics, I admit that they often make the web page visually more appealing and often also more usable, if used carefully. As I’m not so visual person, my skills with tools like Paint Shop Pro, Photoshop and Paint.NET are limited. When playing around with the Office 2007 I thought, why wouldn’t I use it for doing the graphics? It can save you a lot of time to get Web 2.0-ish effects like gradients and glass table effects (reflection) that are a trend these days. Just take a look at atlas.asp.net, for example. The process goes like this:
Here are some examples that I did with the PowerPoint 2007 Beta 2 in a few minutes. Disclaimer: Examples were done quickly just to show how easy they are to make. They are not supposed to be prime examples of web graphics ;) 2006/5/26 ODF vs. Open XML discussions continueThere is a really interesting blog entry in Brian Jones’s blog about competing document standards. Now that Microsoft’s formats are based on XML, there are lots of comparisons and discussions about the ODF and Open XML -formats. Basically for the ODF-side thinks that Microsoft should ditch the Open XML for ODF or at least add support for the latter. Like Brian Jones mentions in the quote below, the arguments are mostly political:
The article in questions goes into detail about technical differences between the formats/specifications and rises an issue about numbering formats. While it may seem like a little issue, localization etc makes things more complicated. There is also a nice set of comments. Check especially this one by M. David Petterson Quote:
Elsewhere there are also heated conversations about ZDNet.com article where “Microsoft claims that the OpenDocument Format (ODF) is too slow for easy use.” I think that while a common file format for office documents would be a nice idea in the perfect world, it is still quite impossible to achieve in the real world. There would always be different implementations, bugs etc by each maker. Just look at where we are with supporting of the (X)HTML/CSS standards and browsers. While many latest browsers support them quite well (excluding IE6), there are still lots of minor differences while the specs are much simpler than those of Word, for example. Fortunately, due to the nature of the XML and open specifications, interoperability between office suites will be much easier to implement in the future. |
|
||||||||||||||||||||||||||
|
|