Add function decorator pattern
This commit is contained in:
48
StructureHelperCommon/FunctionDecorator.cd
Normal file
48
StructureHelperCommon/FunctionDecorator.cd
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Class Name="StructureHelperCommon.Models.Functions.TableFunction" BaseTypeListCollapsed="true">
|
||||
<Position X="3" Y="3" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAgAAAAAAAAAAAAAAAQAAAAIAAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Functions\TableFunction.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Class Name="StructureHelperCommon.Models.Functions.FormulaFunction" BaseTypeListCollapsed="true">
|
||||
<Position X="1.25" Y="3" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAgAAAAAAAAAAAAAAAQAAAAIAAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Functions\FormulaFunction.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
<Lollipop Position="0.2" />
|
||||
</Class>
|
||||
<Interface Name="StructureHelperCommon.Infrastructures.Interfaces.IOneVariableFunction">
|
||||
<Position X="2" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAgAAAAAAAAAAAAAAAQAAAAIAAAAAQAAAAAAAAA=</HashCode>
|
||||
<FileName>Infrastructures\Interfaces\IOneVariableFunction.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperCommon.Models.Functions.IScaleFunction">
|
||||
<Position X="9" Y="3" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Functions\IScaleFunction.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperCommon.Models.Functions.ILimitFunction">
|
||||
<Position X="7.25" Y="3" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Models\Functions\ILimitFunction.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Interface Name="StructureHelperCommon.Infrastructures.Interfaces.IFunctionDecorator">
|
||||
<Position X="8" Y="0.75" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>Infrastructures\Interfaces\IFunctionDecorator.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Interface>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
||||
14
StructureHelperCommon/Infrastructures/Enums/FunctionType.cs
Normal file
14
StructureHelperCommon/Infrastructures/Enums/FunctionType.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Enums
|
||||
{
|
||||
public enum FunctionType
|
||||
{
|
||||
TableFunction,
|
||||
FormulaFunction
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface IFunctionDecorator
|
||||
{
|
||||
public IOneVariableFunction OneVariableFunction { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface IOneVariableFunction
|
||||
{
|
||||
public FunctionType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool Check();
|
||||
public double GetByX(double xValue);
|
||||
}
|
||||
}
|
||||
40
StructureHelperCommon/Models/Functions/FormulaFunction.cs
Normal file
40
StructureHelperCommon/Models/Functions/FormulaFunction.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public class FormulaFunction : IOneVariableFunction
|
||||
{
|
||||
public FunctionType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public double GetByX(double xValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class CopyOfFormulaFunction : IOneVariableFunction
|
||||
{
|
||||
public FunctionType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public double GetByX(double xValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
StructureHelperCommon/Models/Functions/ILimitFunction.cs
Normal file
14
StructureHelperCommon/Models/Functions/ILimitFunction.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public interface ILimitFunction : IFunctionDecorator
|
||||
{
|
||||
public void Limit();
|
||||
}
|
||||
}
|
||||
14
StructureHelperCommon/Models/Functions/IScaleFunction.cs
Normal file
14
StructureHelperCommon/Models/Functions/IScaleFunction.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public interface IScaleFunction : IFunctionDecorator
|
||||
{
|
||||
public void Scale();
|
||||
}
|
||||
}
|
||||
40
StructureHelperCommon/Models/Functions/TableFunction.cs
Normal file
40
StructureHelperCommon/Models/Functions/TableFunction.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Functions
|
||||
{
|
||||
public class TableFunction : IOneVariableFunction
|
||||
{
|
||||
public FunctionType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public double GetByX(double xValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public class CopyOfTableFunction : IOneVariableFunction
|
||||
{
|
||||
public FunctionType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public double GetByX(double xValue)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user