C#C
C#3y ago
30 replies
.tree

❔ Issues in Repository pattern with defining Common Code

Code: https://paste.mod.gg/ybmdfcjlyxwg/0

Situation:
In my code there are multiple implementations that do stuff depending on the underlying DB.
Some of those DBs are open source (GeodatabasePostGIS), some are proprietary (GeodatabaseArcObjects).
Because they both share some code, I made an abstract class that both inherit from (GeodatabaseAbstract).
Since all open source DBs would also share specific code, I defined another abstract class only for them that inherits from GeodatabaseAbstract (GeodatabaseOpenSource).
GeodatabaseAbstract implements an interface.

Goal:
I want to make those common code functions available to the methods of the implementations, but I cant seem to figure it out.
I tried making a sort of wrapper for the abstract methods in GeodatabaseAbstract, but then I get issue regarding protection levels.
Since GeodatabaseAbstract implements the Interface, I can't change the abstracts methods to anything other than public.
A tool for sharing your source code with the world!
Was this page helpful?