views:

62

answers:

1

I have completed a student project, this project extract data from xml files on internet and save to database and displays it. And i use that data in a few different ways e.g. display on main page, in another tab as a table, and to create some graphs.

I did all this by making 5 different classes. Each class extracts different type of XML and save it to database with a single Load() function.

Last requirement of the project is to make the application Update-able/Patch-able (user does not need to download the whole new build to update the application, instead a small patch installer will add feature to application). How do i do that? My teacher says that adding polymorphism will help, a friend says that create different modules of application (break it into parts) so that each class will have its own dll.

What steps i need to do to make it patch-able? How to create dll of classes? how to break application into parts? Or all of this is unnecessary, i should just use a patching software that creates a patch by comparing both builds??

+1  A: 

What you will want to do is follow the steps below:

  1. Create new class projects in your solution, 1 for each of the classes you have.
  2. Add a reference to your main project, 1 for each new project you created.
  3. At this point everything should compile and like Henk said, if you don't change the public part of the assemblies, everything should be fine.

If you want to go a step further though, create a new interface and have the interface implement the methods in your classes. Have all your classes implement this interface. As long as the interface doesn't change, you can change anything you want about the assemblies and classes (as long as your classes keep implementing the interface)

icemanind
"Add a reference to your main project, 1 for each new project you created." but Henk Holterman below said that "select the original Project and use Add Reference to add the asm "
LifeH2O
Anyways, thanks. I got some idea on how to add a dll. As i told that currently i have inherited all my class from one class which contains some data extraction functions (extract the innerText of a node and convert it to required type). Is this approach correct? If it is how do i inherit all dll projects from this class? sorry if have asked something stupid
LifeH2O
Now i have made a DLL. How to make an update patch for this? People talk about ClickOnce but it updates application. While i need to create an installer patch that will update library or other files of my application?
LifeH2O
ClickOnce is a deployment technology. If you were a company or privately funded programmer, you'd use that to deploy your application. You, however, may not be able to use that because I believe ClickOnce applications require a code signing license (which costs anywhere from $200 - $1200 per year. What you will want to do is, create an updater program that will delete the existing DLL and copy the new DLL version to the application directory.
icemanind
To go a step further, what you will want is to distribute that updater application with your main application. Have your main application check for new updates (usually by maintaining an XML file on your application's website). The main program should download this XML file and then execute your updater. Your updater should look at this XML file to determine what file(s) need updating and copy over the appropriate files. The XML file should have a list of all files you distribute with your application, as well as a version number. does this make sense?
icemanind
Thankyou! You have suggested a great good method. I have spent a lot of time with ClickOnce. As a student project they just need completed work no matter how. I read that ClickOnce also updates only those files that are changed. As it comes with VS i think it should be easier to implement, but having problem with how to and where to deploy. I will use your method when i get sick of ClickOnce :)
LifeH2O