- 5 Creative Design Ideas Using Grids – Design School
- 9 GIFs That Explain Responsive Design Brilliantly | Co.Design | business + design
- Pumpipumpe | a sharing community
- The AI Programmer’s Bookshelf
- Practical Tips for Web and Mobile Usability Tests
- Edward Reynolds on Twitter: "http://t.co/FjnCknj4CA"
- IT Pro New Year’s Honours List 2015 – TechNet UK Blog – Site Home – TechNet Blogs
- Web API OData V4 Lessons Learned – DavidHardin – Site Home – MSDN Blogs
- Postcode Lookup with YQL and Great Maps
- Do elite software developers exist?
Now I have arrived to the moment when I want data to be persisted on disk. I choose SqlIte – because EF 7 is not yet on the market and SqlIte could work on Windows Phone / Android.
So now I want to just serialize TableData and save . To serialize I have several options – yesterday was XML, not it is Json. The Newtosnoft Json library could do the serialization – and with SqlIte I could put into a database file.
However, the problem is with what we have for serialization / deserialization and how we have conceived the software.
For example, Table class does not have a public constructor – a Table does not exists without a Moderator to create it – and which Cards to display
internal Table(string moderatorName, List<Card> cards = null)
For Deserializer to work, the Table either should have a public constructor
public Table(): this("", null)
, either the deserializer will have a function to construct the Table.
The first option means that the architecture will be somehow not so good.
The second option means more work for the programmer.
In .NET we have the third option – we can use obsolete:
[Obsolete("Use CreateTable from TableFactory",true)] public Table(): this("", null)
The true option means raising an error when we COMPILE code that uses the constructor – not at run time, when the deserializer uses it.
So we maintain the architecture – and not enforce at run time.
If we wrote
Table t = new Table();
the compiler gives
1>D:\sourcecontrol\Vs\MVC Planning Poker\PlanningPoker2013\PPTest2013\SerializeTableData.cs(68,23,68,34): error CS0619: ‘Table.Table()’ is obsolete: ‘Use CreateTable from TableFactory’
However , the serialization uses happily the constructor – even if it is obsolete , it works!
I have made a campaign on IndieGogo for making a website, videos and tutorials about C# and .NET tools and common practices. Think about verticals( logging, security) that every application needs to have.
It will be a common knowledge base(book, video and website , and mobile application ) about how to use those applications.
Please join at bit.ly/toolsProgrammers
Let’s suppose you have a variable $x=”http://msprogrammer.serviciipeweb.ro/”
In powershell the following are the same
I want to make a function that returns a value . Let’s say
Function Add([string] $a, [string]$b)
#debug to see arguments
return $a + $b
If I call this function with
Add 10 17 # the syntax for calling powershell is WITHOUT comma – the comma indicates arry
However , if I wrote
$x = Add 10 17
it does not wrote
Do you know why ?
Answer in the first comment