Reputation: 1526
I'm a fresh graduate and having trouble which is the best way to create a web project if branching or single web project with many conditions.
FOR EXAMPLE: I have multiple clients with different insight about our system. Some clients want to use certain features while others wont.
SOLUTION 1: Create each branch for each client to separate their project buildup
PROB. ENCOUNTERED: If I have multiple clients who wants the same features it would be very tedious to repeat the programs.
SOLUTION 2: Only have a single project that have many setup conditions to activate feature depending on the clients need
PROB. ENCOUNTERED: This will be slower because each feature that can be unique for each client should have a program condition. It is also much harder to debug in this solution.
Upvotes: 0
Views: 131
Reputation: 23444
Any sort of branching as you suggest is a bad idea. I would recommend that you use Git instead of TFVC in TFS and use Git flow (http://nkdalm.net/Git-Flow) for your branching strategy.
As long as your branches are short lived (hours not days) they can be useful. If you end up with a branch for each customer you will end up with too much technical cruft and ultimately drowning in complexity. This is not a pleasant place to be.
You should invest in, and implement, a good feature toggle system that you can use to enable and disable features for customers. Where you hit an identical algorithm or behaviour that needs to be different per customer you should implement a switch possibly with dependency injection or plugins.
If you use good engineering practices, practice some form of test first, and maintain working code at all times, you should never need more than a single long term branch.
Upvotes: 3
Reputation: 2409
Probably the easiest way is to use a plugin style system. If you define it correctly it will make for updating the system easy if there was a bug in one of the features that a client desires. Now you can still ship the program with all the features, but in a config file you could turn features on and off. Now this will require you having a good logging system in place. Both of these systems require a fair amount of research.
Upvotes: 6