| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# IG::Lib::ISerializationDto< Type > Interface Template Reference

Generic base class for Data Transfer Objects (DTO). This class is used as template for producing concrete DTO classes. Such DTOs are used for serialization and deserialization of state of various kinds of objects that need to be transfered between applications, across platforms, or simply stored in files for future use. More...

Inheritance diagram for IG::Lib::ISerializationDto< Type >:
[legend]
Collaboration diagram for IG::Lib::ISerializationDto< Type >:
[legend]

List of all members.

## Public Member Functions
void | CopyFromBase (BaseType obj)
| Copies data to the current DTO from an object of type BaseType.
void | CopyToBase (ref BaseType obj)
| Copies data from the current DTO to an object of the base type. Object is created anew if necessary by using the CreateObject() method.
void | CopyFromObject (object obj)
| Copies data to the current DTO from an object of type object. The necessary casts are performed.
void | CopyToObject (ref object obj)
| Copies data from the current DTO to an object of type object. Object is created anew if necessary by using the CreateObject() method. The necessary casts are performed.

## Detailed Description

### template<Type>
interface IG::Lib::ISerializationDto< Type >

Generic base class for Data Transfer Objects (DTO). This class is used as template for producing concrete DTO classes. Such DTOs are used for serialization and deserialization of state of various kinds of objects that need to be transfered between applications, across platforms, or simply stored in files for future use.

Interface for Data Transfer Objects (DTO). This class is used as template for producing concrete DTO classes. Such DTOs are used for serialization and deserialization of state of various kinds of objects that need to be transfered between applications, across platforms, or simply stored in files for future use. WARNING: In most cases ISerializationDto<Type> will be used. Different BaseType and Type are used only in relatively rare cases where different derived types all have the same data that is copied to DTO. Otherwise the advantage of this can not be used because of single inheritance.

Template Parameters:

  Type | Type for which DTO is used.

See also:
  SerializationDtoBase<Type, Type>

There is an agreement that all derived classes must have a public argument-less (default) constructor. Generic classes are usually not used for serialization/deserialization. Only derived types where both type parameters are fixed are normally used for this purpos. This class is essentially equal to SerializationDtoBase<Type, BaseType> where BaseType is the same as Type. IMPORTANT: This class does not have base type specified, i.e. it is used for situation where actual object type is not sidtinguished from base type. Base type in the variant with two types (SerializationDtoBase<Type, BaseType>) is used just occasionally because of the benefit of defining copying operation only for base type and use it for different derived types. $A Igor Jun09;

Template Parameters:

  Type | Type for which DTO is used.
  BaseType | Base type of the type for which DTO is used, and on which copy operations will be defined. In this way, we can avoid defining these operations for each specific type, but only define them for a specific type, since operations may be similar for all derived types.

There is an agreement that all derived classes must have a public argument-less (default) constructor. Generic classes are usually not used for serialization/deserialization. Only derived types where both type parameters are fixed are normally used for this purpos. IMPORTANT: Base type is used just for being able to define copying operations only once - for the base type - and using it for different derived types. In many occasions this will not be needed, and in these occasions one should just use the derived type that does not have base type as type parameter.

$A Igor Jun09;

## Member Function Documentation

template<Type >

void IG::Lib::ISerializationDto< Type >::CopyFromBase | ( | BaseType | obj | ) |

Copies data to the current DTO from an object of type BaseType.

Parameters:

  obj | Object whose data is copied to the current DTO.

Implemented in IG::Lib::SerializationDtoBase< Type, BaseType >.

template<Type >

void IG::Lib::ISerializationDto< Type >::CopyToBase | ( | ref BaseType | obj | ) |

Copies data from the current DTO to an object of the base type. Object is created anew if necessary by using the CreateObject() method.

Parameters:

  obj | Object to which data is copied.

Implemented in IG::Lib::SerializationDtoBase< Type, BaseType >.

template<Type >

void IG::Lib::ISerializationDto< Type >::CopyFromObject | ( | object | obj | ) |

Copies data to the current DTO from an object of type object. The necessary casts are performed.

Parameters:

  obj | Object whose data is copied to the current DTO.

Implemented in IG::Lib::SerializationDtoBase< Type, BaseType >.

template<Type >

void IG::Lib::ISerializationDto< Type >::CopyToObject | ( | ref object | obj | ) |

Copies data from the current DTO to an object of type object. Object is created anew if necessary by using the CreateObject() method. The necessary casts are performed.

Parameters:

  obj | Object to which data is copied.

Implemented in IG::Lib::SerializationDtoBase< Type, BaseType >.

The documentation for this interface was generated from the following file:

- SerializationDtoBase.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events