Premessa: tutto è in tono assolutamente scherzoso! lo sai Andrea che ti voglio bbbbbbene...
E poi lo faccio per sfogarmi...con la Juve in B per un anno, ho dovuto subire le sue battutine per un anno...mo' mi vendico....:-)
Andrea estrae la frase dal pezzo di Fowler:
"The essence of a Active Record is of a Domain Model where the classes in the
Domain Model match very closely with the record structure of an underlying database."
ma la riga successiva dice proprio:
"Each Active Record is responsible to saving and loading to the database, and also
any domain logic that acts upon the data."
Oooo...prorprio subito sotto...:-)...fiiiico...SONO GIA' IN VANTAGGIO.
Poi ancora:
"The data structure of the Active Record should exactly match that of the database:
one field in the class for each column in the table."
PALLA BREAK.
E ancora:
"The Active Record class typically has the following method
1. construct an instance of the Active Record from a SQL result set row
2. construct a new instance for later insertion into the table
3. static finder methods to wrap commonly used SQL queries and return Active Record objects
4. methods to update the database and insert into the database with the data in the Active Record
STO SERVENDO PER IL SET.
E ancora:
"It's often difficult to tell the difference between Active Record and Row Data Gateway when you are using a Domain Model. You are using Active Record if your domain objects contain the SQL themselves to access the database, and you're using Row Data Gateway if a separate class does this."
GAME, SET, MATCH! (Cappotto. :-)
Linq to SQL non ha niente dell'Active Record (meno male).