The third (and hopefully last) supported operation is adding some more entries to a list of existing ones.
The second supported operation is deleting a bunch of existing entries.
The first operation that we are supporting is sorting a lost of existing entities.
The second post of the series is a very brief introduction of the foundations of the solution: model binding.
Let me repeat again: model binding is wonderful. And if you are not using it to its full potential, you are running with an iron ball chained to your ankle.
Some months ago had the chance to do some MVC for a client of my company.
I will be writing about some of the (hopefully) interesting and helpful things I did.
So far I have been using Google Code to host my code samples. From now on, all new code samples will be hosted in GitHub.
‘What is what we wanted to achieve, again?’, said the driver, taking a step back from his/here keyboard.
‘Write our beloved .NET code to perform some tasks that can be invoked from the command line.’, answered the bewildered navigator, dilated pupils in awe for the departure of the driver from The Keyboard.
‘Oh, and that hassle of parsing arguments?’, the driver asked, taking a slow approach towards the lonely desk.
‘That? I prefer not to write it, thank you very much.’, suspired a relieved navigator.
Despite having found a sensible framework for console applications (NConsoler) I was kind of put back by their drawbacks, most of them derived by the fact that attributes are used to decorate methods and arguments.
ManyConsole can be easily obtained as a Nuget package to be up and running in no time.
This framework I have used extensively and have been pretty happy with the results. I has its caveats, and that’s the reason this is not my last post of the series
NConsoler can be downloaded as a .zip file from its project page and can be obtained as a Nuget package (remember my rules for OSS libraries?).
Mono.Options comes as a Nuget package that adds source code to our solution. As the doc says is based on callbacks, that is a delegate that gets executed as soon as the command line argument is parsed.
Everything revolves around the OptionSet
and a "mini DSL” that defines the arguments and their aliases, a piece of documentation and the delegate to be executed when the options is present. OptionSet
helps with the parsing of the arguments and displaying the documentation.
Today I am going to write my last console application. I am done with it. My fingers refuse to type (G-d forbid) any parsing code or import any more command-line parsers and/or frameworks.
Yes, shutting services down is becoming fashionable nowadays. It is always sad, but I get some comfort that the ones being shut down are free ones, maybe there is a pattern there…
Thee world moves one. I am getting older more experienced and technologies that I have been using are no longer suitable and/or available. It happened before, it will happen in the future again. It sucks for a while, but then you either look for and use an alternative; or you change your habits altogether and stop doing something you got used to.