Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using subclass 'get' function to access inherited superclass property
Date: Thu, 12 Nov 2009 20:02:18 +0000 (UTC)
Organization: Xoran Technologies
Lines: 20
Message-ID: <hdhpka$4v1$1@fred.mathworks.com>
References: <hd4h94$g23$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1258056138 5089 172.30.248.38 (12 Nov 2009 20:02:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Nov 2009 20:02:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:584678


"Janice " <janice_chou@yahoo.com> wrote in message <hd4h94$g23$1@fred.mathworks.com>...
> Hi all,
> 
> I have read several posts about the problems with overloading a superclass 'set'/'get' function, but I'm interested in simply writing a subclass 'get' function that is able to return an inherited superclass property.
===========

There isn't much of a distinction there. If the superclass doesn't define a get() method, a default get method is used (one that applies no restrictions to the get operation).

=====================
 It seems that the 'get' function is blind to the superclass properties, despite the fact that one could simply access this property by using dot notation with the subclass object (if the property is public?) elsewhere in the code.
==================

No. Any attempt to access the property always implictly calls the  'get' function for that property, including the use of dot notation in the classdef file. The same is true outside the classdef file, unless you've used subsref to overload the dot notation in which case subsref will be called instead. But that doesn't change much - once subsref executes, you'll be in the workspace of the class definition once again where any attempt to access the property calls the get method.



> Am I going about this the wrong way? I tried extending the superclass 'get.logfile_name' method in the subclass TrialBasic.
====

Yes. Just use the superclass' get method, or dot notation. It doesn't appear that you need any more than that.