Code Elegance

Archive for December, 2007

[SK#5] CTRL-SHIFT-F

CTRL-SHIFT-F Find in files. Search for a word in the files of your solution (filtered with pattern).

Technorati Tags:
No comments

[SK#4] SHIFT-F

SHIFT-F Open the Find window dialog. This window is about searching a word in the current file, current project or solution.

Technorati Tags:
No comments

[SK#3] CTRL-K, CTRL-U

CTRL-K, CTRL-U remove comment from the selected code or the current line if no selection is present.

Technorati Tags:
No comments

[SK#2] CTRL-K, CTRL-C

CTRL-K, CTRL-C comment the selected code or the current line if no selection is present.

Technorati Tags:
No comments

[SK#1] F5

F5 Starts your application in the debugger. If you press it when you are in breakpoint mode it goes until the next breakpoint

Technorati Tags:
No comments

[SK#0] A ShortcutKey a day

In the last months I realize how much important is for a developer leave the mouse in favor of keyboard. If you learn to use the keyboard in the right way your productivity rise a lot.

For this reason I begin to learn the Visual Studio and Resharper shortcuts key and I assure you that for every menu item there is a keys combination that do the same thing.

The base keys are Shift, Ctrl and Alt. To these we have to add a letter or a number.

The best way to learn this shortcuts is to learn one a day, that’s why I decided to start a new section on this blog to publish a shortcut a day (almost).

All the post refers to Visual Studio C# default settings and Reshaper with Intellij IDEA.

Technorati Tags:
No comments

From Database to UI and back

Which approach do you use in developing applications?

Years ago, for me, was a must that the develop of new application begin from the database and over there I design the DAL and up till the user interface. For this reason the firsts days was dedicated to the design of the database. What I got was an application based on “Transaction Script” or “Table Data Gateway” with their pros and cons.
At that time the database was the most important thing in my applications.

The problem with bottom-up approach is that it takes you to create a myriad of “micro-methods” that makes very tedious developing other layers above DAL. The classic “error” is to create all the CRUD operation for every tables in database, discovering later that a lot of them are useless or that they force the other layers to know the database structure (for example they need to know the right insert order to not break the foreign constraints).
The other smell was that the design of my application was not very Object Oriented, the only thing that I used was a little bit of inheritance in the DAL to reuse some code dedicated to manage the database connection.

In 2003 i read a book that change the life to a lot of developer “patterns of enterprise architecture”.

After having read it I understand that something in my approach to  design application should be improved: I discovered the Domain Model.
Then I begin to think at my applications starting from Domain Model and once the DM was ready I start with Database and User Interface at the same time.

Now I’m in a transition period and I feel to start my applications from User Interface. I know that the UI is for the final user the most important thing of the application (stated that it works), not from a aesthetics point of view rather from an interaction and usability point of view and the way the data is displayed on the forms.
The first thing I do is to design (on paper) the mockup of the UI thinking about the interaction work-flow and the data that should be displayed. From the interface I go down to the Domain Model and then the Database.

The problem with starting from Domain Model is that your User Interface design is often binded to it and is not free to achieve the user’s needs. So starting from UI is a natural way to obtain what the customer really want, maximizing the usability and the fruibility of information.

This is not a proofed methodology for me, I’m trying this way in these months. For now I can certainly say that the mockup on paper likes a lot because the user can easily try to imaging how the interaction with the software will be and he can modify the stories of writes a new one. The Domain model grow in a more natural way guided from the functionality to implement.

Does this state that the DM and DM are less important? Absolutely not, but the user don’t bother them. 

No comments