public abstract class Statement
{
...
}
public abstract class Statement
{
public IEnumerable<Statement> ChildStatements { get; }
...
public Statement(params Statement[] childStatements)
{
...
}
}
public abstract class Statement
{
public IEnumerable<Statement> ChildStatements { get; }
public Statement(params Statement[] childStatements)
{
}
}
public abstract class ExecutionStatement : Statement
{
}
public abstract class ConditionalStatement : Statement
{
public ConditionalStatement()
{
}
public ConditionalStatement(params Statement[] childStatements) : base(childStatements);
{
}
}
public abstract class FileManipulationsStatement : ExecutionStatement
{
public string FileName { get; set; }
}
public class WriteFileDataStatement : FileManipulationsStatement
{
public string Data { get; set; }
}
public class FileAccesibleConditionalStatement : ConditionalStatement
{
public FileAccesibleConditionalStatement()
{
}
public FileAccesibleConditionalStatement(params Statement[] childStatements) : base(childStatements);
{
}
Let’s create Write statement:
WriteFileDataStatement write = new WriteFileDataStatement();
Let’s create FileAccessible conditional statement for this:
FileAccesibleConditionalStatement fa = new FileAccesibleConditionalStatement(write);
Physical execution
This approach makes possible to easy define execution statements but doesn’t account physical execution.
It is proposed to use associated classed for each statement for physical execution. I am going to describe this approach in next article.
This article also available:
PDF: Statements.pdf
MS Word: Statements.doc