![]() |
Re: überkreuzender Bezug von Units .. kleiner Workaround
Abstraktion ist auch ein Grundprinzip der OOP
|
Re: überkreuzender Bezug von Units .. kleiner Workaround
ICh habe auch so ein "überkreuzender Bezug"-Problem:
Delphi-Quellcode:
Im Moment verwende ich folgende Deklaration:
unit Descriptor;
uses Token,...; TSecurityDescriptor = Class(TObject) ... {@Name combines a parent and a creator security descriptor into a new security descriptor. For detailed information see MSDN [url]http://msdn2.microsoft.com/en-us/library/aa446581.aspx[/url] @param(ObjectType A Pointer to a GUID that defines the type. Set to nil if it does not exist.) @param(GenericMap Defines the generic map class which maps generic access rights to specific access rights.) @param(Token defines the token instance which is used to check for access. Can be nil to use process or thread token.) } constructor CreatePrivateObjectSecurity( const ParentSecurityDescriptor: TJwSecurityDescriptor; const CreatorSecurityDescriptor: TJwSecurityDescriptor; const ObjectType : PGUID; const IsDirectoryObject : Boolean; const AutoInheritFlags : Cardinal; const GenericMap : TJwSecurityGenericMappingClass; const Token : TSecurityToken = nil); //Fehler ... end. unit ...Token; uses Descriptor,...; TSecurityToken = Class(TObject) ... {Sicherheitsdeskriptor für das Token} property SecurityDescriptor : TSecurityDescriptor read GetSecurityDescriptor write SetSecurityDescriptor; ...
Delphi-Quellcode:
Dabei wird Token auf den Typ überprüft :
constructor CreatePrivateObjectSecurity(
const ParentSecurityDescriptor: TJwSecurityDescriptor; const CreatorSecurityDescriptor: TJwSecurityDescriptor; const ObjectType : PGUID; const IsDirectoryObject : Boolean; const AutoInheritFlags : Cardinal; const GenericMap : TJwSecurityGenericMappingClass; const Token : TObject = nil); //Ok
Delphi-Quellcode:
Was könnte man da Vernünftiges machen?
if not (Token is TSecurityToken) then
raise |
Re: überkreuzender Bezug von Units .. kleiner Workaround
Zitat:
Ein TButton kommuniziert ja auch nur über Events wie OnClick zum Formular zurück und nicht mit dem direkten Aufruf eines Formulars, auf dem es sich befindet..... Und deswegen lässt er sich ja so universell verwenden :-) Deine Tokenklasse ist wahrscheinlich auch universell? Ansonsten, das Prinzip mit der ClassHelper Lösung nicht verstanden? .. hmmm |
Re: überkreuzender Bezug von Units .. kleiner Workaround
Zitat:
Und wie soll denn hier ein Event funktionieren? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:13 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz