Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
3rdRail
Blackfish SQL
C#Builder
C++BuilderX
CodeCentral
Conference
DBArtisan
Delphi for PHP
Delphi Prism
Delphi-BCB
EDN
InterBase
JBuilder
JBuilder 2007
Kylix
Optimizeit
QualityCentral
Test project
You are not logged in.
Help
Print
Public Report
Report From:
[ Add a report in this area ]
Report #:
8073
Status:
Closed
Attributes visibility with class completion
Project:
Build #:
7.1.1523.17956
Version:
8.0
Submitted By:
Gerard Visent
Report Type:
Basic functionality failure
Date Reported:
5/6/2004 6:30:52 AM
Severity:
Commonly encountered problem
Last Updated:
6/7/2005 1:18:04 AM
Platform:
All platforms
Internal Tracking #:
Resolution:
As Designed
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
When declaring a public or published property, and calling class completion, the getter and setter methods and the internal field are declared with the same visibility as the property.
This has been reported in QC#7003 and closed by Corbin Dunn.
However, the field should remain private to the class, otherwise it doesn't make sense to have getters, setters and properties.
Example:
TFoo = class(TObject)
private
public
FName : string; <--- This should be private
procedure set_Name(const value: string);
public
property Name: string read FName write set_Name;
end;
Steps to Reproduce:
Declare a new class, declare a new property in that class and press CTRL-SHIFT-C.
Workarounds
None
Attachment
None
Comments
Joe White at 5/6/2004 1:52:57 PM
-
You mention attributes twice, but your sample code doesn't include any attributes at all. Did you mean to refer to fields?
Gerard Visent at 5/7/2004 6:45:39 AM
-
Yes, sorry. Has been corrected.
Jeremy North at 6/7/2005 1:16:08 AM
-
As mentioned in the 7003 resolution. This is As Designed. Some .NET languages do not have properties and wouldn't then be able to call your code as you wished. If you do move the code to the private section the compiler creates methods for you which then means 2 function calls happen when you access your property.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us