Hello and thanks for any assistance.
using .Net 3.5 C#;
Say i have about 10 methods that all follow the same pattern
Using 3 as an example:
public Customer CreateCustomer(Customer c) { .. }
public Car CreateCar(Car c) { .. }
public Planet CreatePlanet(Planet p) { ..}
the internal logic of each method has the exact same pattern.
IE:
public Customer CreateCustomer(Customer c)
{
Log.BeginRequest(c, ActionType.Create);
Validate(customer);
WebService.Send(Convert(c));
Log.EndRequest(c, ActionType.Create);
}
public Car CreateCar(Car c)
{
Log.BeginRequest(c, ActionType.Create);
Validate(c);
WebService.Send(Convert(c));
Log.EndRequest(c, ActionType.Create);
}
The same is true with CreatePlanet and the other 7 methods.
Can these methods be re-written, they all follow the same pattern, and I feel like I am missing something... Is there is another level of abstraction that could be derived?
Question: How should this be re-written to take advantage of proper architecture pattens?
Thanks, Steven