4

I'm using C#.NET 2010

I'm working a POS project for 20 outlets and it already installed and utilized in each outlets. One day there's a change in form say Payment Method, I have to redesign the UI form as well as modified the logic codes.Then I recompile the project and send update to all outlets and it's not easy to do. Then I have an idea, I need to separate each form in the project as modules (I'll use DLL files if it's ok), so when I modified a form I don't need to recompile all. I just modify and compile needed form and update it to outlets.

So can I compile a form to a DLL? if so how to achieve that? Or maybe I'm not in right track to get my idea?

Thanks in advance..

dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
Akhtar
  • 69
  • 3
  • 10

5 Answers5

3

Updated

As has been pointed out by the comment on the CP Article, the previous answer has many flaws. This article has better implementation of the plugin architecture in C#. You may also refer to this answer for more option.

Previous Answer

You can use a plugin architecture to do that. Here's a very good article that might help you.

This article demonstrates to you how to incorporate a single module, as a plugin for another application or use it as a standalone application. The article will demonstrate how a minimal change is required to obtain the above result.

Community
  • 1
  • 1
John Isaiah Carmona
  • 5,260
  • 10
  • 45
  • 79
0

You can have a form in a DLL. A form is just another class, usually a number of classes actually (i.e partial classes), like any other class in a DLL, and you would reference just the same. You just have to make sure it is public so it accessible by external assemblies.

You just have to be wary, it is probably a good idea to keep forms that work closely together (i.e common references) in the same assembly. You can run into difficulties by over modulation.

nickm
  • 1,775
  • 1
  • 12
  • 14
0

I don't see any problem with distributing a DLL. It would be a good idea for security to make sure it is signed (this can be done in VS 2010 via the project properties). You should probably define an interface for your payment UI functionality which would then be implemented by the class(es) in your DLL. The calling part of your app (the non-changing UI) can then make calls via this interface instead of via actual (concrete) form objects.

dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
0

You can Publish a ClickOnce Application and it will reduce Difficulties in updating applications.

Damith
  • 62,401
  • 13
  • 102
  • 153
0

I am more interested with the reason when you said " Then I recompile the project and send update to all outlets and it's not easy to do and why do you think "separate each form as module/DLL" would fix your issue..it is because the size of the DLL compiled from all projects are too big to send? if you are trying to separate each form into its own module/dll, then you might finally have multiple projects with one solution...

Q Will
  • 11
  • 1