Stuff I learned from TechFest 2009
I like to recap after attending a conference, a seminar, or whatever learning experience I've been through. So here's the recap of my TechFest 2009:
JQuery:
- Home Page
- Best way to debug JQuery: using Firebug
- A great way to do Unobtrusive JavaScript
- When design a page, try moving all JavaScript away from the page (move into an external file). This approach even helps performance (because of caching)
- Beware of problem between ASP.Net Ajax and JQuery (more...). The problem seems to be on the dollar sign namespace. There are tricks to resolve the problem.
- Someone used the "Noconflict()" call as work arourd but some said it doesn't work.
- QUnit makes it possible to unit test JQuery.
New Features in C# 3.0
- CodeRush and Resharper are both amazing refactoring tool
- People use Extension to create DSL (Domain Specfic Lanaguage)
Mock and Stub
- Difference between mock and stub
- Need to define test in more specific way: automated test (may call db or external stuff), unit test (no external call), integration test (calls all the shit to get real world result)
- We should strike for spending more time on Unit Test and less on integration test, cause Unit test is useless unless you got very fast feedback
- Darker Color scheme may help your productivity. Here's some schemes to choose from for VS 2008. Here's a nice dark color scheme. And here's why it's good.
- Speaker suggested Rhino Mocks
- Rhino Mocks relies on the fact that object are all using an interface
- When there's a block of logic you want to externalize, you can refactor that set of code into a class, with a correspsonding interface. And then for the constructor of the current code you require the interface being passed in in your constructor, but at the same time provide a default constructor that have the interface instance created for the user.
- ShouldEqual seems more expressive than Assert, but it seems to be a Microsoft Visual Studio thing.
- Speaker mentioned a book called "Legacy Cookbook". Could not find it, but I found this.
- specification pattern : Class represent logic that return True or False
- Assert method got called once only
- Stub : provide predeginded return value
- Spec.stub
- Static class not friendly to mock
- Try use generic mock, var, the C# 3.0 feature.
- For void , Use assertWasCalled, like need to check to make sure it is being called
- For others,(non void) predictable result, use stub
Static Test
- Findbugs. - java
- PMD - java
- FXCop - .Net
- Xssdetect. Cross site scripting
Use these tools as preventive effort
Owasp open review project
Antisamy.net
More info : Blogs.nsdn.com/fxcop
Entity Framework
- Still have problem when syncing databack. But maybe there's a soluition.
- Linq to Entity is the best way to use entity framework
- By default Entity Framework use Defer execution, but you can force it to do Immediate execution using keyword include
- EF is an example of ORM
- Great book by Juila Lerman called Programming Entity Framework
0 Comments:
Post a Comment
<< Home