Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am learning OOP, SOLID principles and design patterns. I have designed data structure of in-memory database in C#. Please provide suggestions to improve it better considering solid principles, OOP and design patterns.

abstract class Entity
{
    public string Name { get; set; }
    public Guid Id { get; set; }
}

//singlton instance of Database class
sealed class DataBase : Entity
{
    private static DataBase dbInstance; //single instance of Database
    private List<Table> lstTables;// list of tables in database class

    private DataBase() { }
    public static DataBase GetDataBase() { if (dbInstance == null) dbInstance = new DataBase(); return dbInstance; }

    //parse th query and prepares the command and execute ICommand.Execute and ICommand.Parse command
    public void Execute(string query) { }

    //factory method that returns COmmand object
    private ICommand GetCommand(string query)
    {
        //returns appropriate ICommand object 
        throw new NotImplementedException();
    }

    public void AddTable(Table objTbl) { throw new NotImplementedException(); }
    public void DropTable(string name) { throw new NotImplementedException(); }

    internal Table GetTabelBYName(string name) { throw new NotImplementedException(); }
}

class Table : Entity
{
    private List<Column> lstColumns; //list of columns
    private List<Row> lstRows;  // list of rows

    public void AddColumn(Column clmn) { }
    public void RemoveColumn(string clmn) { }
    public void AddRow(Row row) { }
    public Column GetColumnByName() { throw new NotImplementedException(); }

}

class Row : Entity
{
    public List<Cell> lstCells
    {
        get;
        set;
    }
}

class Cell : Entity
{
    public Column clmn { get; set; }
    public object Value { get; set; }
}

class Column : Entity
{
    public ColumnType type;
    private Dictionary<string, object> lstAttributes;
}

enum ColumnType
{
    INT, STRING, DECIMAL, DATETIME
}

enum CommandType { Select, Insert, Update, Delete, Alter }

interface ICommand
{
    bool Parse();
    bool Execute();
}

class SelectCommand : ICommand
{
    public Table tbl { get; set; }
    public List<Column> lstColumns { get; set; }
    public string whereCondtin { get; set; }


    public bool Parse()
    {
        throw new NotImplementedException();
    }

    public bool Execute()
    {
        throw new NotImplementedException();
    }
}

class InsertCommand : ICommand
{
    public Table tbl { get; set; }
    public List<Cell> lstColumns { get; set; }
    public string whereCondtin { get; set; }


    public bool Parse()
    {
        throw new NotImplementedException();
    }

    public bool Execute()
    {
        throw new NotImplementedException();
    }
}

class UpdateCommand : ICommand
{

    public Table tbl { get; set; }
    public List<Cell> lstColumns { get; set; }
    public string whereCondtin { get; set; }

    public bool Parse()
    {
        throw new NotImplementedException();
    }

    public bool Execute()
    {
        throw new NotImplementedException();
    }

}

class DeleteCommand : ICommand
{

    public Table tbl { get; set; }
    public string whereCondtin { get; set; }


    public bool Parse()
    {
        throw new NotImplementedException();
    }

    public bool Execute()
    {
        throw new NotImplementedException();
    }

}

class AlterCommand : ICommand
{
    public Table tbl { get; set; }
    public List<Cell> lstColumns { get; set; }

    public bool Parse()
    {
        throw new NotImplementedException();
    }

    public bool Execute()
    {
        throw new NotImplementedException();
    }

}
share|improve this question

closed as off-topic by Heslacher, janos Jun 6 at 6:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1  
IMO this isn't reviewable in its current state. Sure one could nitpick on variables names and not needed comments but having all the throw new NotImplementedException(); this looks more like stub code which is off topic. – Heslacher Jun 6 at 5:41