-
Notifications
You must be signed in to change notification settings - Fork 38
Gerardo Sullivan Code Review #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add better accessibility, unused references, line spacing, Method naming conventions, etc.
Order should be its own concept as part of this application. Reports should be able to just take an order and output the details in a particular way
TODO: need to think of some auto generator for Order Number
Handle ints better, reuse code
| string address = GetUserInputAsString("Please input your Address: "); | ||
|
|
||
| // TODO: should probably be DateTime with valid user input for DateTime | ||
| string dueDate = GetUserInputAsString("Please input your Due Date: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be parsing user input into DateTime
| public string CustomerName { get; set; } | ||
| public string Address { get; set; } | ||
| public string DueDate { get; set; } | ||
| public string DueDate { get; set; } // TODO: should probably be DateTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be DateTime
| public string DueDate { get; set; } // TODO: should probably be DateTime | ||
| public int OrderNumber { get; set; } | ||
| public List<Shape> OrderedBlocks { get; set; } | ||
| public List<Shape> OrderedBlocks { get; set; } = new List<Shape>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OrderedBlocks data structure should be its own class with properties for each Shape type i.e.
public class OrderedBlocks
{
public List<Square> Squares { get; set; }
public List<Triangle> Triangles { get; set; }
public List<Circle> Circles { get; set; }
}
| public string ToString() | ||
| public override string ToString() | ||
| { | ||
| return "\nName: " + CustomerName + " Address: " + Address + " Due Date: " + DueDate + " Order #: " + OrderNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: String interpolation better
| PrintRow("Square",base.OrderedBlocks[0].TotalQuantityOfShape().ToString()); | ||
| PrintRow("Triangle", base.OrderedBlocks[1].TotalQuantityOfShape().ToString()); | ||
| PrintRow("Circle", base.OrderedBlocks[2].TotalQuantityOfShape().ToString()); | ||
| PrintRow("Square", Order.OrderedBlocks[0].TotalQuantityOfShape().ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order.OrderedBlocks[0] is very ugly and prone to bugs, find a more reliable data structure for each block type.
Quick fix is check list for type Square
e.g. Order.OrderedBlocks.Where(b => b is Square)
| class CuttingListReport : Order | ||
| public class CuttingListReport : Report | ||
| { | ||
| public int tableWidth = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tableWidth can be const
| class InvoiceReport : Order | ||
| public class InvoiceReport : Report | ||
| { | ||
| public int tableWidth = 73; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
| { | ||
| public string Name { get; set; } | ||
| public int Price { get; set; } | ||
| public int AdditionalCharge { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current data structure only allows for one AdditionalCharge per shape.
Possible solution is for each attribute of the shape to have some AdditionalCharge (i.e. the colour and shape type)
| { | ||
| abstract class Shape | ||
| // TODO: rename this to Block | ||
| public abstract class Shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want colour to be its own class with properties (e.g. surcharge)
| public abstract void GenerateReport(); | ||
|
|
||
| public string ToString() | ||
| public override string ToString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer not to override the .net class ToString() method. Rather just have a Print() method or something like that
No description provided.