- (Un)serialize from/to any source. Build an abstraction (
Map
) that could be implemented for SQL, NoSQL (Key-Value, Document...), JSON APIs, or anything that needs to build objects from scalar data. - Default to a table per entity, but allow views and multiple models from various data sources, even the ability to connect them (through events?).
// Write model: event sourcing?
class BookPublished(string $title, string $description, Author[] $authors, ...){}
class BookReviewed(Book $aBook, User $reviewer, string $review, int $rating){}