On récupère le code du compte avec relevé:
class compte =
  object 
    val mutable solde = 0.0
    method solde = solde
    method dépôt x = solde <- solde +. x
    method retrait x =
      if x <= solde then (solde <- solde -. x; x) else 0.0
  end;;
    
class compte_avec_intérêts =
  object (self)
    inherit compte
    method private intérêts =
      self # dépôt (0.03 *. self # solde)
  end;;
    
class bon_compte =
  object
    inherit compte_avec_intérêts as super
    method dépôt x =
      if x > 0.0 then super # dépôt x
      else raise (Invalid_argument "dépôt")
  end;;
    
type opération = Dépôt of float | Retrait of float
    
class compte_avec_relevé =
  object (self) 
    inherit bon_compte as super  
    val mutable registre = []
    method private trace x = registre <- x::registre
    method dépôt x =
      self#trace (Dépôt x);  super # dépôt x
    method retrait x =
      self#trace (Retrait x); super # retrait x
    method relevé = List.rev registre
  end;;
On définit maintenant le module Compte:
let date()= (1998,10,30);;
    
module Compte = struct
  class compte_bancaire = compte_avec_relevé
  class type vue_du_client = object
    method dépôt : float -> unit
    method relevé : opération list
    method retrait : float -> float
    method solde : float
  end
  class client x : vue_du_client =
    let y = if x >= 1000. then x
    else raise (Failure "Apport_insuffisant"in
    object (self)
      inherit compte_bancaire initializer self#dépôt y end
  let promotion x =
    let c = new client x in
    if date() < (1998,10,30) then c # dépôt 100.; c
end;;