Skip to content
Snippets Groups Projects
Commit 7cb32587 authored by AFONY10's avatar AFONY10
Browse files

Clean up

parent fa435b0e
No related branches found
No related tags found
No related merge requests found
...@@ -74,73 +74,3 @@ namespace ATB_ChainPattern ...@@ -74,73 +74,3 @@ namespace ATB_ChainPattern
} }
} }
} }
//using System;
//using System.Collections.Generic;
//using ATB_ChainPattern.DummyData;
//using ATB_ChainPattern.BaseHandlers;
//using ATB_ChainPattern.ConcreteHandlers;
//namespace ATB_ChainPattern
//{
// public class DistributeHandler : ProductHandlerBase
// {
// public override void AnalyzeProduct(ProductData product)
// {
// // Validate the product name and type
// if (!ProductData.ProductTypeMap.ContainsKey(product.ProductName))
// {
// Console.WriteLine("Invalid product name. Request closed.");
// return;
// }
// List<ProductType> productTypes = ProductData.ProductTypeMap[product.ProductName];
// if (!productTypes.Contains(product.ProductType))
// {
// Console.WriteLine("Invalid product type. Request closed.");
// return;
// }
// // Determine the appropriate handler based on the product type
// IProductHandler handler = GetSuccessor(product.ProductType);
// // Set up the chain
// SetSuccessor(handler);
// // Pass the product name to the chain root for analysis
// successor.AnalyzeProduct(product);
// }
// private IProductHandler GetSuccessor(ProductType productType)
// {
// // Determine the appropriate handler based on the product type
// switch (productType)
// {
// case ProductType.Stock:
// return new StockHandlerBase(null); // No further successor for now
// case ProductType.Currency:
// return new CurrencyHandlerBase(null); // No further successor for now
// case ProductType.Commodity:
// return new CommodityHandlerBase(null); // No further successor for now
// // Add cases for other product types as needed
// default:
// throw new ArgumentException("Invalid product type.");
// }
// }
// protected override bool CanAnalyzeProduct(ProductData productName)
// {
// // Dummy implementation, always return true since DistributeHandler doesn't perform actual analysis
// return true;
// }
// protected override void Analyze(ProductData productName)
// {
// // Dummy implementation, no actual analysis needed in DistributeHandler
// // You can optionally throw an exception here to indicate that this method should not be called
// // throw new InvalidOperationException("Analyze method should not be called in DistributeHandler.");
// }
// }
//}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment