|
-
Feb 10th, 2006, 10:09 AM
#1
Thread Starter
Member
How do I maintain two similar but different programs ?
Hi,
Sorry for the confusing title (but interesting I hope) !
I am developing an application for two companies that are 90% similar and different only in cosmetics (graphical elements of GUI), and some company specific customisations. These are mostly cosmteic but numerious in quantity.
Since the application is not 100% complete and not into test phase, I am expecting quite a number of changes in the code. Now how do I make sure that changes and improvements I made in one are not missed in another and at the same time or I do not have to repeat the same changes to another.
Is there any tool or any specific way of managing codes for this kind of scenario ?
TIA
-
Feb 10th, 2006, 10:14 AM
#2
Fanatic Member
Re: How do I maintain two similar but different programs ?
How large is the project?
One design methodology to implement this scenario is the n-trier model. This splits the application into layers - most usually interface-business logic-data. You develop all your non-gui functions in seperate libraries that can be linked to quite different User interfaces.
This is most often used on larger projects though.
You could just try farming out all your re-usable code to a seperate .dll and then link to a single version in you differing interfaces.
Failing that, you can share visual basic class and module files between projects - it's not ideal but it does mean that if you change it in one place it will be reflected in the other.
Just a few ideas for you.
Martin J Wallace (Slaine)
-
Feb 10th, 2006, 10:19 AM
#3
Re: How do I maintain two similar but different programs ?
If this is just a desktop application there is of course no need to use the n-tier design. But you should always separate the GUI design from the internal logic. Put all the logic of the application in classes (which you of course can compile separately into a DLL, like Slaine suggested, if you like but you can also put each of the classes into each project as well). The GUI will now simply call the different methods and properties of these classes from where ever they should be called. Which might be from the main menu in one app, while the other calls a particular method from a dialog box or whatever.
-
Feb 10th, 2006, 10:29 AM
#4
Thread Starter
Member
Re: How do I maintain two similar but different programs ?
Ah, I should have done proper planning first !
Initially my goal was to get something working quick and dirty and it grew and grew !
So I'm afraid its all code mixed in the form events ! There are a lot of classes though (only what I've resued from others, what I myself did is all in forms !!)
I'd not expected to do it for multiple companies. Seems like I've got a lot of cleaning to do. Unless somebody can advise me another quick and dirty way to do things for now 
At least until I meet the deadline for now and re-organise the mess I created.
-
Feb 10th, 2006, 10:38 AM
#5
Re: How do I maintain two similar but different programs ?
Well, quick and dirty is fine, if you want a quick and dirty application. As you've noticed even a small app can quickly grow to a large project and the only way to get rid of the dirt is to clean it up
-
Feb 10th, 2006, 10:41 AM
#6
Re: How do I maintain two similar but different programs ?
 Originally Posted by Joacim Andersson
Well, quick and dirty is fine, if you want a quick and dirty application. As you've noticed even a small app can quickly grow to a large project and the only way to get rid of the dirt is to clean it up 
This should be posted in the cubes of every programmer on the planet!
-
Feb 10th, 2006, 11:32 AM
#7
Re: How do I maintain two similar but different programs ?
One other way is to use conditional compilation. You write a block of code that certain parts will execute if the compilation variable is one value and execute another if its a different value, etc.
VB Code:
#If iCompany = 1 Then
'Blah, blah, blah...
#Else If iCompany = 2 Then
'Blah, blah, blah...
#Else
'Blah, blah, blah...
#End If
You can declare the compilation variable in the project properties under the Make tab - Conditional Compilation Arguments:
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 10th, 2006, 11:37 AM
#8
Re: How do I maintain two similar but different programs ?
 Originally Posted by RobDog888
You can declare the compilation variable in the project properties under the Make tab - Conditional Compilation Arguments:
Or directly in the code:However conditional compiler constants are always private to the module in which they are declared. Using this approach might be good if there are small differences in the code between the two different apps, but they aren't very useful to create different GUIs.
-
Feb 10th, 2006, 11:41 AM
#9
Re: How do I maintain two similar but different programs ?
Right but if you declare them in the project properties they are Public. It is a good way to keep different version of the same program if they are small changes. Just thought I would throw it out there as a means of initializing the change for his program. Easiest and fastest changes are always better when working against a budget.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 10th, 2006, 11:45 AM
#10
Thread Starter
Member
Re: How do I maintain two similar but different programs ?
Thanks for the idea Rob. Didn't know that technique. Yeh that will be immensely helpful at some places of the proj I am working on.
But for others (esp the GUI), it seems I'll have to reorganise my things.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|