1 / 2

Data Accessor Services and Locking Mechanism in Object-Oriented Programming

This structured system allows for state information with locked data access, validation, and conversion functions in OOP environment. Functions include adding/removing accessor, notifying changes, and managing locks.

taariq
Télécharger la présentation

Data Accessor Services and Locking Mechanism in Object-Oriented Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TDataElement Minimum required state information: property DataLocked: Boolean; read only property DataLocker: TDataAccessor; read only property DataValid: Boolean; function DataToText: String; virtual procedure TextToData(TextRep: string); virtual Services for friends: procedure AddAccessor(Accessor: TDataAccessor); procedure RemoveAccessor(Accessor: TDataAccessor); procedure Notify(ChangeEvent: TChangeEvent); procedure GrabLock(Accessor: TDataAccessor); procedure ReleaseLock(Accessor: TDataAccessor); TDataAccessor Procedure Create(BaseUnits: String); property Value: Float; property BaseUnits: String; read only property DisplayUnits: String; function DataToText: String; override procedure TextToData(TextRep: String); override TNumData TNumAcc Create(ADataElement: TDataElement); property OnChange: TChangeEventHandler property DataValid: Boolean property Locked: Boolean; read only property Locker: TDataAccessor; read only property HoldsLock: Boolean; read only procedure GrabLock; procedure ReleaseLock; procedure Create(Anum: TNumData); property Value: Float; property Units: String; Key Inheritance Association Class

  2. OnTempChange: update display if AofTemp.Value out of limit then do user dialog try AofX.GrabLock; AofX.Value := user input; AofX.ReleaseLock; except Couldn’t get lock AofTemp: TNumAcc AofX: TNumAcc Wsht: TWorksheetAccerssorGateway Temp: TNumData AofTemp: TNumAcc X: TNumData AofTemp: TNumAcc if AofX.DataValid then AofTemp.Value:= 273.0+AofX.Value; AofX: TNumAcc AofX: TNumAcc Wizard UI Form Worksheet SubCalculation

More Related