dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #26110
Re: Namespace for CSG primitives
On Mon, Nov 05, 2012 at 09:28:42PM +0100, Johan Hake wrote:
> On 11/05/2012 09:47 AM, Garth N. Wells wrote:
> > On Sun, Nov 4, 2012 at 6:50 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> >> On Sun, Nov 04, 2012 at 05:26:53PM +0000, Garth N. Wells wrote:
> >>
> >>>> One option could be to rename mesh classes to UnitSquareMesh,
> >>>> UnitCubeMesh, and keep deprecated (sub)classes UnitSquare, UnitCube
> >>>> indefinitely to keep backwards compatibility.
> >>>>
> >>>
> >>> No point in renaming if the deprecated names are to be kept indefinitely.
> >>>
> >>>> In summary, I would like to add the new classes to namespace dolfin
> >>>> but I'm looking for opinions on how to best handle naming conflicts.
> >>>>
> >>>
> >>> I'm always in favour of a consistent, meaningful interface over a
> >>> sub-optimal interface for the purpose of backward compatibility.
> >>
> >> So what are our options?
> >>
> >> The actual name clashes are between Rectangle/Rectangle and Box/Box (+
> >> maybe some more that I'm overlooking).
> >>
> >> We could suffix everything:
> >>
> >> RectangleGeometry
> >> RectangleMesh
> >>
> >> or
> >>
> >> RectangleShape
> >> RectangleMesh
> >>
> >> to keep it shorter.
> >>
> >> One could argue that the suffix is only nedded for the meshes, since a
> >> Rectangle(Geometry) is really a rectangle, whereas the RectangleMesh
> >> is not a rectangle; it's a mesh of a rectangle.
> >>
> >
> > I would prefer the suffix only for the meshes, e.g.,
> >
> > Rectangle
> > RectangleMesh
>
> +
ok. Sounds good to me. Decided then:
- Rename mesh classes --> MeshFoo (RectangleMesh, UnitSquareMesh)
- Put geometry classes in namespace dolfin as just Foo (Rectangle)
- Make UnitSquare and UnitCube subclasses of UnitSquareMesh and
UnitCubeMesh and add deprecation warnings to the constructors of the
subclasses that they will be removed in the future
Benjamin, please fix before merge.
--
Anders
Follow ups
References