الكائنات مقابل الجداول
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
name the four ways objects and tables do not fit together.
الموضوعات المخطط لها
- This gap is called the object-relational impedance mismatch.
- Identity: Java has
==andequals; tables have a primary key. - Inheritance: objects have subclasses; tables have no such thing, so you choose a layout.
- Associations: objects hold references (and can point both ways); tables use foreign keys (one direction, many-to-many needs a join table).
- Granularity: one object may hold nested value objects (
Money), while a table row is flat.
تفاصيل المخطط المبدئي
عرض عملي
a drawing of Order with a List<OrderLine> next to the tables orders and order_line with a foreign key.
اختبر فهمك
Which mismatch is shown by a Money object stored in two columns?
أظهر الإجابة
Granularity.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.