design patterns - Daily XML Parsing in ASP.NET MVC Application -
i have asp.net mvc4 application uses entity framework domain model, domain model sits in own project within same solution. populating database store, web application dependant on xml file gets generated once day.
i have couple of questions. 1 related best architectural approach in terms of code placement , system design.
- where should parsing code go parsing xml document , storing parsed data ef database? know can place pretty everywhere, in terms of best software practice, go best? idea @ moment create class (xmlparser) in domain project.
- how can xml parser (where ever i've decided place it) run once day @ particular time?
thank you.
i think domain not best place xml parser. domain is, name suggests, there represents entities , terms of business domain.
classes suchuser
,order
etc. go in there. xml parser not part of business domain.
should parser go, then? let's think it's job is- reads data data store , transforms domain classes.
after representing issue in such way, think solution obvious- class responsible retrieving data data store (be database, file or web service) belongs in data access layer.there couple of solutions. quartz.net scheduling mechanism .net platform lot of advanced scheduling capabilities.
however, if you're looking execute once day, windows' scheduled tasks enough
Comments
Post a Comment