Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this intended Behaviour ?
Message
From
03/12/2003 06:19:32
Matthias Will
BiCON Systemtechnik GmbH
Karlsruhe, Germany
 
 
To
03/12/2003 05:38:02
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00855319
Message ID:
00855344
Views:
18
>Hallo Mathias,
>würde ich schon denken.
Schade eigentlich ;-)

>
>If you read the help for Properties and methods
>Protected properties cannot be accessed by object instances, but can be accessed by subclasses. Hidden properties cannot be accessed by either object instances or subclasses.
>it follows that a pretected object accessible only within it's parent. If you would like to have information about the object (or run a method) you need to ask objects parent to do the job (the code for that is up to you, naturally).
>
>IOW it is the sense of protecting an object to prevent it from external access.
That's true - I agree that this could be seen in this way - but it looks like a kind of philosophical issue to me. To prove the "common"-way of handling this - I created a C#-sample which shows that C# (I now found a real application for .NET for me ! ;-)) handles the same issue in the way I would expect it...

Liebe Grüsse
Matthias
using System;

namespace ConsoleApplication2
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			Test2 lT = new Test2();
			Console.WriteLine(lT.GetTest().TestString);
		}
	}
	public class Test
	{
		public String TestString = "Test";
	}
	public class Test2
	{
		protected Test _Test = new Test();

		public Test GetTest()
		{
			return _Test;
		}
	}
}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform