now i have three class which i use to ship and those are Purolator, UPS and FedEx and each function has one common method which is Ship. now tell me how to use factory design pattern to make my code more reusable.
here is my sample code
--------------------------------
- public class Purolator
- {
- public void Ship()
- {
- //-- code logic to implement shipping method for Purolator
- }
- }
- public class UPS
- {
- public void Ship()
- {
- //-- code logic to implement shipping method for UPS
- }
- }
- public class FexEx
- {
- public void Ship()
- {
- //-- code logic to implement shipping method for FexEx
- }
- }
Ramesh PalanivelPosted Apr 4, 2017, 5:31 AM
Posted Apr 4, 2017, 5:11 AM
Ramesh PalanivelPosted Apr 4, 2017, 5:07 AM
{
{