[Dune-devel] Public interface of GridView

Martin Nolte nolte at mathematik.uni-freiburg.de
Fri Feb 21 13:57:56 CET 2014


Hi Oli, hi all,

looking into Dune::Entity, the "copy constructor from implementation", i.e., 
Entity( EntityImp ), is not protected at all. If you protect such a 
constructor, even the grid implementation itself can no longer create the 
object (e.g., entity or grid view) without first deriving something from the 
facade class.

Protecting the type "Implementation" is, however, our current style. This has 
also been done for the GridView. Unfortunately, the GridView also publicly 
exports this type as GridViewImp. I suggest to remove this typedef alltogether.

As for the copy constructor from implementation: I would like it to remain 
public. If you really know what you get yourself (and others) into, I will not 
object to making it protected as long as it remains public if 
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS is set.

Best,

Martin

PS: What does AIUI mean? I really like this style - you never know what the 
other guy intends to say. Is there some dictionary for such "new words" to 
plain old English?

On 02/21/2014 11:00 AM, Oliver Sander wrote:
> Am 21.02.2014 10:44, schrieb Markus Blatt:
>> Hi,
>>
>> On Wed, Feb 19, 2014 at 02:32:50PM +0100, Oliver Sander wrote:
>>> I have been looking at the interface of the GridView class, and I have noticed that
>>> it publicly exports its implementation type GridViewImp.  Also, there is a public
>>> constructor from a GridViewImp.  Is that intentional?  Usually we try to hide these
>>> implementation classes from the normal user.  Shouldn't the type & constructor be protected
>>> instead?
>>
>> In an ideal world, where we know that we have thought about everything in our
>> interface, the answer would be yes. In the current world and state I
>> would say no, unless ...
>>
>> I do not see the implementation as an implementation per se. It is
>> more like how  a grid view looks for the developer of a specific
>> grid. There might and probably already are cases where the underlying
>> view provides some more advanced features that are not accessible via our
>> interface. Giving users and grid developers the possibility to access
>> the type and the instance of the implementation might allow them to
>> write specialized code for this kind of grid and gain either
>> performance or more functionality.
>
> We have had that discussion before, and the current consensus, AIUI, is that we
> require wrapper classes for everything except for the grid itself.  People that
> want to access the engine classes directly need to set EXPERIMENTAL_GRID_EXTENSION.
> Consequently, the constructor from Imp is currently protected in all classes
> (Entity, Geometry, etc), except for the GridView.
>
> --
> Oliver
>
>>
>> Of course, if we do not demand from the grid developers to use our
>> engines classes (not really sure whether we do or do not), then people
>> could get the same by providing native GridView classes. In this case
>> we could/should probably protect type and constructor.
>>
>> Just my 2 cents.
>>
>> Markus
>>
>>
>>
>> _______________________________________________
>> Dune-devel mailing list
>> Dune-devel at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-devel
>>
>
>
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
>

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune-devel mailing list