c# - Which Design Pattern I should follow when passing different data type to a library? -
i creating csv export library input data come different source can have user data exported csv , can have orders data exported csv.
i thinking of creating feedcsvprocesser prepare csv input data.
the input data of defined type users userfeed, orders of ordersfeed , share common interface ifeedtype. can use di principle , have csv extract data ifeedtype using reflection , prepare csv. approach right, not sure kind of design pattern following or should there.
please guide ?
it seems doing well. don't seek design pattern if don't have problem yet. respect kiss , yagni principles. keep following ood principles you've mentioned.
the important thing in case making "feedcsvprocesser" decoupled files should work on. don't want change class each time have new class exported.
as mentioned, dependency inversion principle specific form of doing so. high-level module "feedcsvprocesser" should not depend on low-level modules ("orders", "users"). both should depend on abstractions ("ifeedtype").
Comments
Post a Comment