Question

One of the specifications for an application I'm developing is that it must work with project files. My problem comes into how I'm going to fulfill this requirement because, since I'm working toward making the application as loose as possible using Prism and Unity, I can't decide on which implementation I'm going to use for the project files creation and managing (project files loading, saving, etc).

The application is going to be a SEO helper and will mostly handle text information, like Uri's and strings it will fetch from internet.

I thought of some possible implementations using:

a - The framework System.Configuration namespace. This was my first option, since I could easily plug new ConfigurationSection's into the Configuration object. The downside is that it leaves no opportunity (or at least I couldn't figure how) for using interfaces for abstraction.

b - Create a database for each project and save it in a file. With this implementation I could use a database framework such as nHibernate or any other (open to suggestions) to handle the object-to-db mapping.

c - Add your own here.

My question is, what do you guys think would be the better approach to handle different configuration/settings for every module that I plug into it and for persisting big lists of urls, lists of about 10k~100k urls as long with other settings?

Thanks in advance!

Was it helpful?

Solution

The simplest way will be to define your own type (class) like ProjectSettings { ... } and simply have it serialized/deserialized with the preferred serializer (XML for example).

Then you simply don't need any fancy ORMs or configurations. Don't introduce complexity where you don't need it ;)

OTHER TIPS

Configuration file is a good solution when you have few dozen configuration variables ( But here, it 's better to have database.Why? Because if you want to do some modification on 10-100k uri, it will be hard and error will be easy. With a database (one table for project, another for string connections, another for uri..), it will be easy to query it, update it, CRUD it. you have to use database when data are to big for a file in this case because of relationship between entities (one project have many string connection, many uri...) For ORM, Entity Framework 4.0 because it is POCO (no metadata on entities class mapped). Best regard

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top