@implementation Person : CPObject 
{ 
	CPString name; 
	CPString jobTitle; 
	CPString company; 
} 

+ (id)personWithName:(CPString)aName 
{ 
	return [[self alloc] initWithName: aName]; 	
} 

- (id)initWithName:(CPString)aName 
{ 
	self = [super init]; 
	if (self)
	{
		name = aName; 
		jobTitle = @""; 
		company = @""; 
	}
	
	return self; 
} 

- (void)setName:(CPString)aName 
{ 
	name = aName; 
} 

- (CPString)name 
{
	return name; 
} 

- (void)setJobTitle:(CPString)aJobTitle company:(CPString)aCompany 
{
	jobTitle = aJobTitle; 
	company = aCompany; 
}

-(CPString) description
{
	return [[CPString alloc] initWithFormat:@"name: %@ jobTitle: %@ company: %@", name, jobTitle, company];
}

- (void)encodeWithCoder:(CPCoder)coder
{
	// debugger;

	// [super encodeWithCoder:coder];
	[coder encodeObject:name forKey:@"name"];
	[coder encodeObject:jobTitle forKey:@"jobTitle"];
	[coder encodeObject:company forKey:@"company"];
}

-(id)initWithCoder:(CPCoder)coder
{
	// debugger;

    //if (self=[super initWithCoder:coder]) {
    if (self=[super init])
    {
		name = [coder decodeObjectForKey:@"name"];
		jobTitle = [coder decodeObjectForKey:@"jobTitle"];
		company = [coder decodeObjectForKey:@"company"];
	}
    
    return self;
}

@end 



@end 
