How can multiple developers efficiently work on one force.com application?
Asked Answered
E

6

17

The company I work for is building a managed force.com application as an integration with the service we provide.

We are having issues working concurrently on the same set of files due to the shoddy tooling that is provided with the force.com Eclipse plugin. If 2 developers are working on the same file, one is given a message that he can't save -- once he merges he has to manually force the plugin to push his changes to the server along with clicking 2 'Are you really sure' messages.

Basically, the tooling does a shoddy job of merging in changes and forces minutes of work every time the developer wants to save if another person has modified the file he's working on.

We're currently working around this by basically 'locking' individual files by letting co-workers know who is editing a file.

It feels like there has got to be a better way in this day and age. Does anyone know of a different toolset we could use, process we could change, or anything we can do to make this easier?

Elegit answered 2/8, 2010 at 15:43 Comment(0)
K
7

When working with the Force.com platform my current organisation has found a number of different approaches can work depending on the situation. We all use the Eclipse Force.com plugin without issues and have found the following set ups to work well.

We have a centralised version control system that we deploy from using a series of ant commands to a developer org instance. We then depending on the scope of the work either separate it off into chunks with each developer having their own development org and merging the changes and testing them regularly, or working in a single development org together (which if you have 2 developers should be no major problem) allowing you to have almost instant integration.

If you are both trying to work on the same file you should be pair programming anyway, but if working on two components of a similar system together, sharing the same org can allow you to develop in a fast and flexible manner by creating the skeleton of the system you wish to use and then individually fleshing out the detail.

I have used both methods extensively and a I say, work really well depending on the situation.

Keaton answered 24/9, 2010 at 11:50 Comment(2)
That's a really well worded answer. Very clear. Also, this is exactly what we ended up doing.Elegit
I changed the answer to this because it is such a well worded and helpful answer. While Eyescream's has a nifty trick, this answer would be more helpful to those that come to look at this later.Elegit
H
6

Each developer could work in separate development sandbox (if you have enterprise edition, I think 10 sandboxes with full config & limited amount of data are included in the fee?). From time to time you would merge your changes (diff tool from any version control system should be enough) and test them in integration environment. The chain development->integration->system test->Q&A-> production can be useful for other reasons too.

Separate trick to consider can be used if for example 2 guys work on the same trigger. I've learned it on the "DEV 401" course for Developers.

  1. Move all your logic to classes. Seriously. They will be simpler to unit test too.
  2. Add custom field (multi-select picklist) to User object. Values should be equal to each separate feature people are working on. It can hold up to 500 values so you should be safe.
  3. For User account of developer 1 set "feature1" in the picklist. Set "feature2" for the other guy.
  4. In the trigger write an if that tests presence of each picklist value and enters or leaves the call to relevant class. This wastes 1 query but you are sure that only the code you want will be called.
  5. Each developer keeps on working in his own class file.
  6. For integration test of both features simply set the multiselect to contain both features.

I found this trick especially useful when other guy's code turned out to be non-optimal and ate too many resources. I've just disabled his feature on my user account and kept on working.

This trick can be to some extend applied to Visualforce pages too (if you can divide them into components).

If you don't want to waste query - use some logic like "user's first name contains X" ;)

Holmun answered 2/8, 2010 at 18:13 Comment(3)
I like that solution, but that sounds like alot of setup would be involved. I'm going to leave the question open for a few days at least, but this does sound like a viable way to go to scale.Elegit
This is basically the answer the Salesforce gives, but with a few tricks added. wiki.developerforce.com/index.php/Documentation :-)Elegit
If anyone has a better solution, I would be happy to change the answer to another one. However, this looks like the best workable solution for now.Elegit
K
6

We had/have the exact same problem, we have a team of 10 Devs working on a force.com application that has loads of apex classes (>300) and VF pages (>300).

We started using Eclipse plugin but found it:

  1. too slow working outside of the USA each time a save is called takes > 5 sections
  2. to many merge issues with a team of 10 developers

Next we tried developing in our own individual sandboxes and then merging code. This is ok for a small project but when you have lots of files and need changes to be pushed between sandboxes it becomes impossible to manage as the only thing worse then force.com development tooling, is force.coms deployment/build tools. No automation its all manual. No easy way to move data between sandboxes either.

Our third approach was to just edit all our VF pages and Apex code in the browser. (not using their embedded editor that shows up in the bottom half of the page because that is buggy and slow) but just using the regular Editor under setup > develop > Apex classes. This worked ok. To supplement this we also had a scheduled job that would download all our code and save it into our SVN repository. We also built a tool that allow us to click a folder on our desktop and zip its contents and deploy it as static resources for us.

However this approach still has its short comings, i.e. it is slow and painful to develop in the cloud, their (salesforce) idea of Development As a Service is crazy. Also we have no real SCM we only have it acting as backups.

Bottom line is force.com is a CRM and not a Development platform, if you can? run, flee, get away from it as fast as you can. Using it for anything apart from a CRM is more trouble then it is worth. Even their Slogan "No Software" makes me laugh everytime

Kaohsiung answered 5/8, 2010 at 0:24 Comment(1)
Thanks for sharing how your group solved this. I did notice that their web page saving was much faster than their Eclipse plugin. Also, the tool to build/upload the static resources sounds like a great idea!Elegit
A
1

I'm not familiar with force.com, but couldn't you use source control and pull all the files down from force.com into your repository. Then you could all do your work, and merge your changes back into the mainline. Then whenever it's necessary push the mainline up to force.com?

Autoroute answered 2/8, 2010 at 17:47 Comment(1)
The problem with that approach is that you need to push the changes into some environment to unit test your code. You can't save and test force.com code locally. This development environment is typically shared, but as eyescream mentions above, it's possible to do some jiggery-pokery using developer accounts.Cupo
A
1

Take a look at the "Development Lifecycle Guide: Enterprise Development on the Force.com Platform". You can find it on developer.force.com's documentation page.

Artieartifact answered 3/8, 2010 at 10:23 Comment(1)
The manual basically says the same thing that eyescream says above.Elegit
M
0

You might want to consider working on separate static resources and pages and then just being careful when editing objects, classes etc.. If most of your development happens on client side code (page, staticresource, lightning component/app) you might be interested in this project: https://github.com/bvellacott/salesforce-build . In any case I strongly suggest using version control. If not on a server then at least locally on your machine, in case your peers overwrite your work.

Mediant answered 22/2, 2017 at 0:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.