Solved

Customising Windows Application

Posted on 2014-02-20
10
126 Views
Last Modified: 2014-07-01
I have a windows application using MS SQL Server & windows clients written in vb.net. I need to heavily customise parts of it for a second customer which means we will have a vanilla flavour for one customer while the second will use some parts of the vanilla flavour and some parts will be customised to their requirements.

We think this is likely to be the pattern in the future where each new user needs a degree of customisation. I am not sure how to structure the project - I don't want two separate applications.

I am thinking of putting each user's bespoke code in a dll and keeping the vanilla code in the original exe but not having done this before I would like to know if this would work or if there is a better way.

Look forward to hearing from you all.

TIA
0
Comment
Question by:Paul-Brooks
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 23

Expert Comment

by:Michael74
ID: 39872829
Personally I would do the reverse and have the vanilla code in the dll with all of the common methods available, this way you could reference it in each new instance you create and instantly have these methods available.

If you go this route have a look at ILMerge to combine the dll and exe files into one
http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx

Another idea to use would be leave the original code in place and use inheritance to create new classes that reuse, extend, and modify the behavior of the original classes
http://msdn.microsoft.com/en-us/library/ms173149.aspx

Michael
0
 

Author Comment

by:Paul-Brooks
ID: 39873182
Hi Michael,

Maybe I am thinking about this the wrong way round but I am hoping to end up with one application which contains the core of the product (~80%). The other 20% is likely to be different for every user.

The application is fundamentally a stock system so the transaction processes look like they will be common but the types of the "stock" of each user are very different. Rather than expanding the characteristics of each stock type to cover all stock types I intended to break them up and allow each to have its own forms / updates or whatever but isolated from teh vanilla version.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39874013
Can you tell us a bit more about what the difference will be between customers?
0
 
LVL 40
ID: 39874787
We might be able to help more once you have answered CodeCruiser request. Splitting code between an application and a dll, with one of them customized, is often the best solution.

But there is an alternative, depending on the type of customization you want to do and the number of different customized versions, where everything can be done in only one application through the help of Configurations.

You could create a Configuration for each user. That means that in the Debug/Release configuration dropdown at the top of the screen, you would have extra entries, one for each customer.

In the Project's Advanced Compile properties, you define a Custom constant for each customer.

In your code, you work with #If, #Else and #End If the following way:

#If ConstantForCustomer1
   'Custom code for customer 1
#Else
   'Common non-customized code
#End If

When you select Customer1 in the configuration dropdown, only the code before the Else is compiled. You have a .exe for Customer 1. Otherwise, only the code in the Else is compiles, there is your standard version. It's easy to know what happens, because the code that will not compile is greyed out in the code window (unless you have an old version of Visual Studio, before 2008 if my memory is good).

Since by default, each configuration compiles in its own directory (bin\Release, bin\Customer1), its easy to manage the different versions.

If need be, complete modules, classes or forms can be treated that way.

In one file:

#If ConstantForCustomer1
    Public Class Form1
        'Customized form for customer 1
    End Class
#End If

In another file:

#If ConstantForCustomer2
    Public Class Form1
        'Customized form for customer 2
    End Class
#End If

The form has the same name, so it works with the common code, but the one that compiles for customer 1 application will be different than the one that compiles for customer 2.

If you have dozens of customers, this approach is usually less interesting than working with many solutions that share some of the code.

If you have only a few customers, that enables you to keep everything in only one solution.
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 39875591
Have you considered using resource strings?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Paul-Brooks
ID: 39876280
The application is for managing industrial & commercial waste. It records the origin, the characteristics of the material and the disposal route. The origins & disposal routes are fairly straightforward - basically customers & suppliers and individual batch numbers per item or container provide traceability.

The difficultly is in defining the materials their characteristics, hazards, disposal restrictions and operator permissions. For a chemical business almost all their operators are permitted to book in and dispose of harmless materials but hazardous materials have to be further tested and classified then disposed of through specific routes and only by authorised users. The materials and their characteristics are fairly specific to the business's processes.

Contrast that with disposing of high value laboratory equipment which has a completely different set of items some of which might be taken apart to salvage high value scrap, particularly hazardous components or parts for resale.

Suppose we said each business needs around 10 characteristics (not all of which are used on every item) the for two versions I need twenty which isn't a problem but I can't let each see 10 characteristics they wont use. Usually there will be one characteristic responsible for the hazard (flammable solvent, asbestos lining, highly toxic additive, etc) but few will be found in more than one business unless we are lucky.

Hope this help, please ask for clarification if you wish.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39876885
I would suggest that you define a few properties for material such as Name, Type/Category, Whether or not its hazardous etc and then use EAV(Entity Attribute Value; basically as many key/value pairs as you need) type model for storing any additional properties of the materials.
0
 

Author Comment

by:Paul-Brooks
ID: 39877077
Storing the properties of materials isn't so much of a problem, it is behind the scenes and out of sight of users but the chemical company uses a list of about 15 properties to define all its waste types. The lab equip company looks like it might need 12 properties but these are different (apart from the name) to those needed by the chemical company.

The waste type maintenance screens are going to little in common and even the booking in screens which record details for actual batches are going to be different.

I don't really understand how the EAV model helps here but I am happy to listen.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39877103
You have different properties for each type of businesses.

You have different screen for each type of businesses.

Application is different, data is different. There is not much in common there.

There could be some common classes defined in a dll that would be reused for all applications, such as the charts, spelling checker and toolbars/ribbons that of the Office.dll that is reused by all applications in the Microsoft Office Suite.

But apart from that, I see it as totally different applications.
0
 

Author Comment

by:Paul-Brooks
ID: 39877190
Hi James,

I can't really afford to write a 'new application' for each customer so maybe I need to look harder at identifying what is common between them both and designing that as the "core product'.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now