473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Enforcing Serialization

We're trying to enforce serialization of all our widely used objects
at our company (our entire company's technology team is probably about
a hundred people) and are trying to come up with a good, automated way
of doing this.

We're considering asking people to explicitly put attributes on all
public objects designating if they are/aren't serializable.

Any thoughts on this being a good/bad idea and alternative solutions?

Feb 13 '07 #1
2 1572
Hello phillipwei,
>Any thoughts on this being a good/bad idea and alternative solutions?
Thoughts, yes... most importantly, I can't really imagine the architecture
that would require the majority of classes to be serializable. Maybe
that's my lack of imagination, but I assume a similar point of view is the
reason why [Serializable] follows an opt-in model.

Otherwise, if you have a guideline and you want to check that people keep
to it - why don't you combine that with your unit tests? I imagine it
would be rather easy, using some reflection maybe, to have an automated
test run for every data layer class (for instance) that would test that
class for correct application of the serialization attribute, or even
better that would actually test serialization at that point.
Oliver Sturm
--
http://www.sturmnet.org/blog
Feb 13 '07 #2

I would say you probably want all Value Objects to be serializable and
thus it would make sense to have standards such as "all solutions must
have a project specifically for value objects named
solution.ValueObjects" and "all value objects must be serializable"
and then you can have standard unit tests that can find all value
object projects within all solutions (assuming a well defined
hierarchy within source control) and enforce these standards.

HTH,

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On 13 Feb 2007 08:26:46 -0800, "ph********@gmail.com"
<ph********@gmail.comwrote:
>We're trying to enforce serialization of all our widely used objects
at our company (our entire company's technology team is probably about
a hundred people) and are trying to come up with a good, automated way
of doing this.

We're considering asking people to explicitly put attributes on all
public objects designating if they are/aren't serializable.

Any thoughts on this being a good/bad idea and alternative solutions?
Feb 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Xamle Eng | last post by:
I am looking for a data oriented schema-enforcing XML editor. By schema-enforcing I mean an editor that doesn't just have a button to verify the schema - I want an editor that actively enforces it...
37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
5
by: Nikola Skoric | last post by:
I ran in Mono a program developed on .NET Framework 2.0 and it ran OK until I tried to desirialize a object. There the program died abruptly dumping this: System.ArgumentOutOfRangeException:...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.