I know what abstraction function and representation invariant are, but I have difficulty writing them on my own. Abstraction Function: A function from an object's concrete representation to the abstract value it represents. Representation Invariant: A condition that must be true over all valid concrete representations of a class. For example:
class Appointment{
/**
* AF:
* IR:
*/
private Time time;
private Intervention intervention;
private Room room;
/** EFFECT initializes to null an appointment
* @param time REQUIRE != null
* @param intervention REQUIRE != null
* @param room REQUIRE != null
*/
public Appointment(Time time, Intervention intervention, Room room){
time = null;
intervention = null;
room = null;
}}
my question is: how could they be written?
Thank you.