using TPersistent as example

This commit is contained in:
Timo Hocker 2020-05-05 09:35:17 +02:00
parent 3783f6b52c
commit ac79bf8ef7

View File

@ -1,11 +1,22 @@
export abstract class Assignable {
protected data: Record<string, unknown> = {};
export interface Assignable {
assign (a: Assignable): void;
assign_to (a: Assignable): void;
}
export abstract class Persistent {
private data: Record<string, unknown> = {};
private properties: Record<string, string>;
public constructor() {
this.properties = this.define_properties();
}
public abstract define_properties(): Record<string, string>;
public assign (da: Assignable): void {
this.assign_object (da.get_data ());
}
public assign_to (da: Assignable): void {
da.assign (this);
}
@ -18,4 +29,6 @@ export abstract class Assignable {
public get_data (): Record<string, unknown> {
return this.data;
}
wip
}