I need some help with the following subject.
The problem is that we are developing a web application using XAF framework, but we are more than five programmers, and we have the inconvenience at trying to manage the code using a version controller, because when various programmers work it in the same project and they want it to commit the change, it give us conflict, principally in the .xafml files on the main project.
Note that our solution contains several projects and the main one, as you can see in the attached image.
Please any help with this topic asap.
we have the inconvenience at trying to manage the code using a version controller, because when various programmers work it in the same project and they want it to commit the change, it give us conflict, principally in the .xafml files on the main project.
I am afraid your current difficulty is not quite clear to us. Would you please describe it in greater detail by providing the additional information in the format below?
1. Steps to reproduce (debuggable samples, screenshots, files before making any changes when everything worked fine);
2. Actual results (screenshots + the files checked in by each developer after which you discovered problems);
3. Expected results.
This information will help us to better understand your scenario and provide you with the most appropriate solution.
For now, I can only give you general information. For instance, if your question/problem is about merging changes made by different developers to the same code block (resolving a conflict) simultaneously, then it is not specific to XAF itself. XAFML files are regular XML files that can be edited and merged by several developers like any other source files put into the VCS. The XAFML content is always saved in a predefined order, thus allowing it to successfully merge diffs automatically in many scenarios. In certain cases (e.g., extensive layout customizations), you may need to semi-automatically replace whole XML blocks instead of merging them.
Even thought there is no generic or universal solution for auto-merging diffs due to the nature of XML, there are many tools that attempt to handle this task if you search for them on the Web: https://www.google.com/search?q=merge%20xml%20version%20control%20system.
Finally, you can greatly reduce the number of merging conflicts by providing a more granular structure for your XAF solution. The idea is that with more separate project modules or areas, developers will encounter far fewer conflicts than with a monolithic application design. For instance, in the main XAF solution in addition to the DevExpress.ExpressApp.Win, DevExpress.ExpressApp.Web and DevExpress.ExpressApp.Mobile, we have dozens of separate modules like Security, Validation, etc. Also, see my recent answer in the T409628 thread on a similar subject. The whole idea is not specific to XAF, but rather to organizing large projects, so you can learn more on this in public community resources on the Web.
The only XAF specifics about working with the version control systems which I can currently think of at this stage are:
1. The Application Model has a layered structure and XAFML files rely on the structure from the previous layers, making it dependent on any changes to them under certain circumstances;
2. Automatic merging of XAFML files can result in an invalid state of the Application Model (e.g., lost layout groups, columns or other items if the diffs are related to the removed elements on the previous layers) even if the XML structure itself is valid.
To avoid any possible negatives from these two specificities during collaborative development, you can consider one of the following approaches:
- Set the IModelDetailView > FreezeLayout and IModelListView > FreezeColumnIndices options to True to stop relying on the previous model layers;
- Perform UI customizations via the last Application Model layer where changes from all previous modules are superpositioned. Depending on the application configuration, this can be done either by invoking the Model Editor for the Model.XAFML file or by using the runtime application UI (e.g., in WinForms) or by using the standalone Model Editor tool. If necessary, the changes done on the last layer can later be merged to lower layers by using the built-in Model Merge Tool.