2008HIRBI19.Eiffel9 - Agendavoordezeles

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Agenda voor deze les De voorstelling van bestanden door objecten Persistentie van expansie-objecten Persistentie van referentie-objecten Persistentie met structuren ABC-winkel met persistentie Studentensysteem met persistentie Bankrekeningensysteem (alternatieve opbouw)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Eiffel voorziet een klasse STORABLE voor het  inrichten van de materialisatie/dematerialisatie naar  (ruwe) bestanden. Objecten kunnen persistent gemaakt worden door  OVERERVING van de klasse STORABLE. Persistente Expansie-objecten kunnen met behulp  van de gewone io-features (bvb. putint() ) behandeld  worden. Persistente Referentie-objecten worden opgehaald  met het feature  retrieved  en opgeborgen met o.m.  basic_store.
Background image of page 2
3 Bestanden aanmaken ... bestandsnaam: STRING student_bestand: RAW_FILE ... -- create bestandsnaam.make(0) bestandsnaam := “c:\data\student.dat" ... create student_bestand.make_open_read_write(bestandsnaam) ... OF student_bestand: RAW_FILE ... io.putstring("Geef de bestandsnaam:") io.readline ... create student_bestand.make_open_read_write(clone(io.laststring))
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 punten_bestand: RAW_FILE ... punt1 := 12 punten_bestand.putint(punt1) ... punten_bestand.readint punt1 := punten_bestand.lastint Persistente Expansie-objecten
Background image of page 4
5 Persistente Referentie-objecten class STUDENT inherit STORABLE creation maken feature naam: STRING nummer: INTEGER punten: ARRAY[REAL] feature maken (naam-invoer: STRING; nummer-invoer: INTEGER) is do ... end --class STUDENT
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Persistente Referentie-objecten class STUDENT_BESTAND_VOORBEELD creation maken feature student_bestand : RAW_FILE student1, student2: STUDENT feature maken is do io.putstring(“Geef een bestandsnaam”) io.readline create student_bestand.make_open_read_write(clone(io.laststring)) studenten_maken_en_opslaan studenten_ophalen student_bestand.close end --maken
Background image of page 6
7 Persistente Referentie-objecten feature studenten_maken_en_opslaan is do create student1.maken(…) create student2.maken(…) student_bestand.go(0) student1.basic_store(student_bestand) student2.basic_store(student_bestand) end --studenten_maken_en_opslaan feature studenten_ophalen is do student_bestand.go(0) student1 ?= student1.retrieved(student_bestand) student2 ?= student2.retrieved(student_bestand) end -- studenten_ophalen end --class STUDENT_BESTAND_VOORBEELD MATERIALISATIE !!
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/17/2011 for the course ECON 43 taught by Professor Lemahieu during the Spring '09 term at Katholieke Universiteit Leuven.

Page1 / 26

2008HIRBI19.Eiffel9 - Agendavoordezeles

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online