DCSIMG
.NET - Uri Lavi

Browse by Tags

All Tags » .NET (RSS)

Code Smells

If you like practicing in identifying code smells, then you can find below a short class called TimerManager . public class TimerManager { public delegate void TimerCallback ( object data); private static readonly object _sync = new object (); private readonly Dictionary < int , Timer > timers = new Dictionary < int , Timer >(); private readonly Dictionary < int , TimerCallback > callbacks = new Dictionary < int , TimerCallback >(); public void SetTimeout( TimerCallback timerCallback...

TechEd 2010 Thoughts

TechEd Eilat 2010 is long over... And with all the hassle of day to day work and other obligations only now I have found a few minutes to write my thoughts. As everybody who has previously attended such a venue would tell you, Microsoft really knows how to set-up and orchestrate such a huge event. It is really impressive to see... Instead of summarizing the events from each and every day I have decided to draw a different perspective and to provide some analysis (which of course reflects my and my...
Posted by Uri Lavi | with no comments
תגים:, ,

Short Roman Numeral Kata

For our second Software Craftsmanship Coding Dojo , I have prepared a "Short Roman Numeral" Kata. In essence, a Short Roman Numeral is a number between 0 to 3999 that has a ToString() method which returns its roman presentation. The rules of roman presentation construction can be found here . After the meeting, I took some time in order to record the Code Kata. As you probably know it is extremely difficult to produce a well synchronized recording . Hence, after a few sleepless nights I...

ALT.NET Tools Night

On 12.07.2010 we have a lot of fun meeting at ALT.NET Tools Night. The topics were: Test Lint - Eli Shalom . CodeRush & Refactor Pro - Me :). NDepend - Dror Helper . Process Explorer - Ariel Raunstien Iron Ruby - Shay Friedman Testify Wizard - Lior Friedman Below you can find three sessions I have managed to record. (Unfortunately, I didn't manage to record more, as I needed to leave earlier.) Enjoy! Many thanks to Lior Friedman, Shay Friedman and Ken Egozi for organizing the event.
Posted by Uri Lavi | with no comments
תגים:, ,

Writing Readable Code - Complex Object Construction

Once upon a time, there was a class called Invoice. Its responsibility was to calculate a final price being presented to the customer. Time went on; The autumn passed, the winter fade out and the spring was already at the door and our class started to rust . Each time a developer found a new set of relevant parameters (that should have been passed to the Invoice class) he added a new constructor, to support them. And so it happened, that after a while, two fellows stumbled on the class: "What's...

Refactoring Tools Review - part II

Oh, my God! I am definitely in love! I finally had the time to play with the latest DevExpress 's Refactor ! Pro and Code Rush . Two distinct main features capture my eyes immediately: The ability to highlight the changes/code smells and refactorings inside the Visual Studio's Editor . It seems that the team invested a lot of effort in order to enable painting on the Visual Studio's editor and canvas. This enables a smooth user experience, without prompting and stalling with unnecessary...
Posted by Uri Lavi | 4 comment(s)
תגים:, ,

Prime Factors Kata

One of the key aspects of a Software Craftsmanship is constant practice. Kata (from Martial Arts) is one form of such practice. The notion of a Code Kata was first introduced by Dave Thomas and can be viewed as: Practice of the same methods, solutions and activities to a perfection. Practice of the same problem, tackling it each time from a different angle or with a different solution. Solving a known problem multiple times utilizing the same methods, enhances the understanding of the specific steps;...

LINQ Podcast

Here you can find a short podcast I recorded with Ran & Ori from Reversim ; The subject is LINQ (in hebrew). The podcast is forty thousand feet overview on LINQ, but it was still a lot of fun :) (mp3 is here .) Many thanks to Ran & Ori !!!
Posted by Uri Lavi | with no comments
תגים:,

Experts Days - 2009

This week we concluded the Experts Days . The sessions were effectively organized (by Eyal Vardi from E4D ), the audience was amazing and the atmosphere was energizing . Here are the headlines of my sessions: I. What's new in .NET 4.0 and VS 2010: The main focus was to emphasize the most important (in my opinion) upcoming features. Here they are: Task Parallel Library, PLINQ and Coordination Data Structures Code Contracts Reaction (Rx) Framework Managed Extensibility Framework (MEF) Dynamic Language...
Posted by Uri Lavi | with no comments

DTOs, Business Entities and Persistency

When designing an application, one can easily confuse DTOs, Business Entities and Persistency. Using the following simple examples I will demonstrate design considerations and thoughts that will dispel some mists. Consider that you want to represent an audio or a movie located on a web page. When you visualize such an object, the first thing you probably see is the data that characterizes it. No surprise here. You applied, without knowing it, an " Information Expert " pattern when you visualized...
Posted by Uri Lavi | with no comments

Notes on C++/CLI

If you asked for my opinion whether to develop an application using (unmanaged) C++, I would strongly advise you to reconsider. Unless you deal with real time applications (or near real time applications), you should better utilize the managed world. Sure, there are times for old good C++; especially when the application's memory footprint is an issue, but needless to say, you have better chances in productivity, ease of development and maintainability in the managed applications (C#, Java and...
Posted by Uri Lavi | 1 comment(s)
תגים:, ,

Refactoring Tools Review - Part I

Don Roberts and John Brant stated in the book Refactoring - Improving the Design of Existing Code : "Refactoring with automated tool support feels different from manual refactoring". Indeed - It is! Having an automated tool that helps you to change the code without the fear of breaking it - is invaluable. That's why, I wanted to summarize several available options for .NET developers. Let's start with the obvious one: Visual Studio Refactoring Tool. As usual Microsoft concentrates...
Posted by Uri Lavi | 4 comment(s)
תגים:, ,

Asymmetric Accessor Accessibility & Automatic Properties

Asymmetric Accessor Accessibility – is a feature that was introduced in .NET 2.0 in order to allow different accessibility levels to get and set portions of a property or an indexer. Those get and set portions are called a ccessors . In the example below, the get accessor is public, whereas the set accessor is restricted and private. private string id; //... public string Id { get { return id; } private set { id = value ; } } Automatic Properties – is a syntactic sugar feature, introduced in .NET...
Posted by Uri Lavi | with no comments
תגים:,

Separate Domain from Presentation – part III

This is a third post in the series of posts about “Separate Domain from Presentation” Refactoring. Previous Posts: Separate Domain from Presentation – part I Separate Domain from Presentation – part II Last time we explained how to refactor towards MVP – Supervising Controller pattern. We left our project in the following state: In this post I will complete the required refactoring steps and will suggest more steps to even deepen the separation of UI and BL concerns. Refactoring Steps: " Extract...

Var{i-able;}

Here is a scoop; The good software engineer is lazy! You don’t believe me? Then ask yourself this: If a good software engineer was not lazy why would he: Automate processes? Reuse a function instead of duplicating its code? Explicitly name a function for its behavior instead of naming a function F1 and providing a non descriptive (and possibly long) documentation? Yet, here is another scoop; The bad software engineer is lazy too! While this statement clearly isn’t a shock to you, it immediately pop...
More Posts Next page »