http://msdn.microsoft.com/en-us/practices/default.aspx
| Figure A |
![]() |
| Serialization |
Uses for serialization
Serialization is used in many scenarios, but the main purpose is to save the state of an object in order to have the ability to recreate the same object when required. It is an important to let the user save work and then be able to continue from that point at a later time. This is a common need in various tools and applications. Serialization is also used in creating a clone of an object.
Another important need for serialization arises when the object is required to travel electronically over wire. In such cases the objects are serialized and deserialized. In fact, serialization is one of the fundamental requirements for techniques such as .NET Remoting.
Even the hibernation mode in the Windows Operating system can be considered a form of serialization.
Types of serialization
The .NET Framework provides certain built-in mechanisms which can be used to serialize and deserialize objects. This functionality can be found in the System.Runtime.Serialization and the System.Xml.Serialization namespaces of the .NET Framework.
Serialization in .NET can be classified into four types as shown in Figure B:
| Figure B |
![]() |
| Four types
|
1. Acquisition Plan
2. Availability Plan
3. Bill of Materials Template
4. Capacity Plan
5. Change Management Plan
6. Concept Proposal
7. Configuration Management Plan
8. Conversion Plan
9. Concept of Operations
10. Cost Benefit Analysis
11. Database Design Document
12. Deployment Plan
13. Design Document
14. Feasibility Study
15. Functional Requirements
16. Installation Plan
17. Interface Control Document
18. Maintenance Plan
19. Needs Statement
20. Operations Guide
21. Risk Management Plan
22. Setup Guide
23. Statement of Work
24. Software Requirements Specification
25. System Boundary Document
26. System Design
27. System Specifications
28. Security Plan
29. Transition Plan
30. Verification Plan
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Alerts;
using System.Drawing;
namespace metest2
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// var db = new DB();
// var query = from s in db.mytest2s
// orderby s.state, s.city
// select new
// {
// s.state, s.city
// };
// DataList1.DataSource = query;
// DataList1.DataBind();
}
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
e.Item.BackColor = Color.Aqua;
if (e.Item.ItemType == ListItemType.AlternatingItem | e.Item.ItemType == ListItemType.Item)
{
String strval = ((Label)(e.Item.FindControl("stateLabel"))).Text.ToString();
String title = (String)ViewState["title"];
if (title == strval)
{
((Label)(e.Item.FindControl("stateLabel"))).Text = "";
e.Item.Visible = false;
}
else
{
title = strval;
ViewState["title"] = title;
((Label)(e.Item.FindControl("stateLabel"))).Text = title;
e.Item.Visible = true;
}
}
}
protected void btn_add_Click(object sender, EventArgs e)
{
if (ListBox1.SelectedIndex > -1)
{
string s = ListBox1.SelectedItem.Value;
ListBox2.Items.Add(s);
ListBox1.Items.Remove(s);
}
}
}
}
lots of IT questions & answers

