你的SVN“项目”有多么精细:一个包含多个相关应用程序的大项目或每个应用程序一个“项目”

时间:2023-01-16 19:55:22

I define a project as an SVN directory containing trunk, branches, tags sub dirs.

我将项目定义为包含主干,分支,标签子目录的SVN目录。

What criteria do you use when determining when to split a project into two or consolidate several projects into one? - One App per "Project" with a shared projects for common source and resources? - One big "project" containing all source and resources for the app?

在确定何时将项目拆分为两个或将多个项目合并为一个时,您使用什么标准? - 每个“项目”一个应用程序,共享源和资源共享项目? - 一个包含应用程序所有源和资源的大“项目”?

Single project or multi project both have their pluses and minus. We are heading more towards a single project and I'm trying to figure out if this s the right approach.

单个项目或多个项目都有其优缺点。我们正朝着一个单一的项目前进,我正在试图弄清楚这是否是正确的方法。

Split projects allow greater ability to control how different parts of the suite incorporate a change. The common library can be version and different applications can chose to use a specific version (maven dep management approach).

拆分项目可以更好地控制套件的不同部分如何包含更改。公共库可以是版本,不同的应用程序可以选择使用特定版本(maven dep管理方法)。

Split project also create multiple class hierarchies making the code more difficult to understand as a whole and potentially leading to code duplication. I would assume that proper design of the overall structure and the relationships between components would be key to managing this cost.

拆分项目还会创建多个类层次结构,从而使代码整体难以理解,并可能导致代码重复。我认为正确设计整体结构和组件之间的关系对于管理这个成本至关重要。

A unified project approach will make it easier on the developer in terms of setting up a workspace, and provide a single class hierarchy. This is a double edged sword as it will also throw much more information at the developer (too many classes to comprehend).

统一的项目方法将使开发人员在设置工作区方面更容易,并提供单个类层次结构。这是一把双刃剑,因为它也会向开发人员提供更多信息(太多的课程无法理解)。

So, when you are trying to decide where to combine and where to split, what rules of thumb do you use?

那么,当你试图决定在哪里结合以及在哪里拆分时,你会使用什么经验法则?

10 个解决方案

#1


We put all the projects related to a single app within one SVN Rep simply for the sake of ease of maintenance, centralizing the app's code base in one repository only and also ability to manage the interdependencies between different resources of the app.

我们将与单个应用程序相关的所有项目放在一个SVN Rep中仅仅是为了便于维护,仅将应用程序的代码库集中在一个存储库中,并且还能够管理应用程序的不同资源之间的相互依赖性。

we generally categorize our resources into different folders within trunk. that categorization is primarily based on the functional /modular grouping or layered grouping [DAL, BLL, GUI, etc.]. that is completely upto how you have structured the code. Hope this helps.

我们通常将资源分类到trunk中的不同文件夹中。该分类主要基于功能/模块化分组或分层分组[DAL,BLL,GUI等]。这完全取决于你如何构建代码。希望这可以帮助。

#2


The SVN Book has a good discussion on both approaches.

SVN Book对这两种方法都有很好的讨论。

In the end I would choose whatever feels more natural to repository users.

最后,我会选择对存储库用户更自然的东西。

Personally, I've favoured a single SVN trunk/tags/branches approach with all my actual code projects in their own folders inside those.

就个人而言,我更喜欢单个SVN主干/标签/分支方法,所有我的实际代码项目都在他们自己的文件夹中。

However, for a larger code-base (I've only managed 3-4 small projects which were part of a single solution), I would highly consider changing to a split approach.

但是,对于更大的代码库(我只管理了3-4个小项目,它们是单个解决方案的一部分),我会高度考虑改为拆分方法。

#3


I use both separate projects and combined projects depending on project size. For our large projects, each one is in a separate repository, and has independent build and deployment procedures. For our smaller projects we have a "tools" repository to contain them, with each sub-project as a subdirectory of the root.

我根据项目大小使用单独的项目和组合项目。对于我们的大型项目,每个项目都在一个单独的存储库中,并具有独立的构建和部署过程。对于我们较小的项目,我们有一个“工具”存储库来包含它们,每个子项目作为根的子目录。

I also maintain a "personal" repository where people can store their test programs one-off utilities, or other things that could benefit from source control and centralized backups, but does not belong as an independent project.

我还维护一个“个人”存储库,人们可以在其中存储他们的测试程序一次性实用程序,或其他可以从源代码控制和集中备份中受益的东西,但不属于独立项目。

#4


I use separate projects and combine them to form a solution through svn:externals.

我使用单独的项目并将它们组合起来,通过svn:externals形成一个解决方案。

#5


One app / module that is deployed independently per project. Using a single project makes it difficult to introduce release cycles if you ever find out you need Maven -ish dependency management with a module depending on stable implementations of other modules. It can also lead to people just using random useful-looking code from other apps directly instead of factoring it out to keep the dependency graph Sane (tm).

每个项目独立部署的一个应用程序/模块。如果您发现需要Maven -ish依赖关系管理与模块取决于其他模块的稳定实现,则使用单个项目会导致很难引入发布周期。它还可以导致人们直接使用来自其他应用程序的随机有用的代码,而不是将其分解以保持依赖关系图Sane(tm)。

You should do integration testing using proper test suites and CI practices at clearly defined , not by relying on half your code failing all of a sudden if one part breaks.

您应该使用适当的测试套件和明确定义的CI实践进行集成测试,而不是依靠一半代码在一个部件中断时突然失败。

Another problem with having a single uber-project is that it's rather onerous for git-svn users that only work on a single module.

拥有一个超级项目的另一个问题是,对于仅在单个模块上工作的git-svn用户而言,这是相当繁重的。

#6


Grow organically. Pre optimization is the root of all evil, Dijkstra once said. Also keep YANGI (you ain't gonna need it) in mind.

有机地成长。 Dijkstra曾经说过,预先优化是所有邪恶的根源。还要记住YANGI(你不需要它)。

Every application gets its own folder with trunk/tag/branches. If the a project within an application gets really big, then it gets pushed to it's own separate folder and can be linked to the application at build time (or even svn:externals).

每个应用程序都有自己的文件夹与trunk / tag / branches。如果应用程序中的项目变得非常大,那么它会被推送到它自己的单独文件夹,并且可以在构建时链接到应用程序(甚至是svn:externals)。

That said, if your project requirements are to develop a complex application written by 10 developers and you are the gatekeeper or build master then you can consider more complex alternatives.

也就是说,如果您的项目要求是开发由10位开发人员编写的复杂应用程序,并且您是守门人或构建主人,那么您可以考虑更复杂的替代方案。

#7


Keep separate SVN repositories for separate projects. The last thing you want is to have a Merge Day

为单独的项目保留单独的SVN存储库。你想要的最后一件事是合并日

#8


You might want to check out Subversion revision number across multiple projects.

您可能想要查看多个项目中的Subversion修订版号。

#9


Thanks for the input. I won't "choose" an answer because I think all have valuable points in them. Avoiding premature optimization does seem key as does keeping the layout as simple as possible for the time being. We are moving to a single project containing the apps because 90% of the time we release ALL together. Therefore, to complicate matters with a one-apps-per-project doesn't seem to make sense. Even when we go to maven it is likely that all maven artifacts for a given version will be made from the same branch. We can always change it later if need be using SVN history and fisheye to keep us sane.

感谢您的投入。我不会“选择”一个答案,因为我认为所有答案都有重要意义。避免过早优化似乎是关键,因为暂时保持布局尽可能简单。我们正在转向包含应用程序的单个项目,因为90%的时间我们一起发布ALL。因此,使用每个项目的一个应用程序复杂化事情似乎没有意义。即使我们去maven,给定版本的所有maven工件都可能来自同一个分支。如果需要使用SVN历史和鱼眼来保持我们的理智,我们总是可以在以后更改它。

We'll refactor the source layout just like we'd refactor the source. When a project starts to "smell bad" from a girth and dependency situation we'll break it up, but not before that. I'll probably use girth in time not girth in space: time to build & test, time to checkout. If I have a 1GB tree that I can checkout in < 10 minutes and build/test in < 30 minutes I don't really need to break it up unless I am required to release parts of it frequently.

我们将重构源布局,就像我们重构源代码一样。当一个项目从周长和依赖情况开始“闻起来很糟糕”时,我们会将其分解,但不会在此之前。我可能会及时使用周长而不是太空周长:建立和测试的时间,结账的时间。如果我有一个1GB的树,我可以在<10分钟内结账并在<30分钟内构建/测试我真的不需要打破它,除非我被要求经常释放它的一部分。

So, thanks for the input. It was really helpful in my framing the question for me team and evaluating options.

所以,感谢您的意见。这对我为团队和评估选项构建问题非常有帮助。

#10


there's no 'good' answer here, but I think there should be a distinction made between SVN repos that contain 1 or 2 projects, and others that contain 100.

这里没有“好”的答案,但我认为在包含1或2个项目的SVN repos与包含100个项目的其他项目之间应该有区别。

I maintain a SVN repo that was migrated from VSS, it has several hundred "projects" in it, none of them have been organised along the trunk/branch/tag structure (in fact I think that structure is really unnecessary and unhelpful after I've used SVN for a while, it certainly doesn't help when you have to tag 2 or 3 projects as a single change).

我维护了一个从VSS迁移的SVN仓库,它有几百个“项目”,没有一个沿着主干/分支/标签结构组织(实际上我觉得这个结构真的没必要,而且在我'之后无益。我已经使用了SVN一段时间,当你必须将2个或3个项目标记为单个更改时,它肯定没有用。

We maintain a project directory for all our maintained software, under that we have subdirs for configuration and another for source. Under those we have product version numbers - so effectively we are throwing away the concept of trunk, we only have tag directories - the highest number being the trunk (we have to do this as we have to support several versions of the projects simultaneously). Merging happens as needed, so if I update a bug in project A, version 3.0; I'll merge those changes to version 4.0 and v5.0.

我们为所有维护的软件维护一个项目目录,在该目录下我们有用于配置的子目录和用于源的另一个子目录。在那些我们有产品版本号的情况下 - 所以我们有效地抛弃了trunk的概念,我们只有标签目录 - 最高的数字是主干(我们必须这样做,因为我们必须同时支持多个版本的项目)。根据需要进行合并,因此如果我更新项目A中的错误,版本3.0;我将这些更改合并到版本4.0和v5.0。

If I were to do a repo with just 1 or 2 projects, I may be tempted to keep the branch/tag structure, but on the other hand - I'd probably keep the directories explicit in the main tree (assuming I didn't release often enough to tag regularly)(I use the revision number as a 'tag' BTW, and I store binaries in there. So if I need to get a particular old revision, I can grab the right binary from looking at the log)

如果我只用1或2个项目进行回购,我可能会想要保留分支/标记结构,但另一方面 - 我可能会在主树中保持目录显式(假设我没有经常发布以定期标记)(我使用版本号作为'标签'BTW,我在那里存储二进制文件。所以如果我需要获得特定的旧版本,我可以从查看日志中获取正确的二进制文件)

Its surprisingly easy to manage considering I have a 10Gb repo with a revnum currently up past 300,000 with lots of old code in there as well as newer. I would recommend the structure to others and will use it again.

考虑到我有一个10Gb的回购,目前有超过300,000的revnum,其中包含大量旧代码以及更新版本,因此它的管理非常容易。我会向其他人推荐这个结构,并会再次使用它。

Incidentally, one other reason tags dir wouldn't work for us is because we release every time there is a bug or change request, no matter how tiny. Our tags directory would be unmanageable after a while, this is why we use the revnum as a tag - we can associate it with the bug tracker to keep it more human readable too.

顺便说一句,标签dir对我们不起作用的另一个原因是因为我们每次都有错误或变更请求时发布,无论多么微小。我们的标签目录在一段时间后将无法管理,这就是为什么我们将revnum用作标签 - 我们可以将它与bug跟踪器相关联,以使其更具人性化。

So to summarise in rough, we have a directory structure like this where v1 and v2 are product versions:

总而言之,我们有一个像这样的目录结构,其中v1和v2是产品版本:

maint/source/v1.0/projectA
maint/source/v1.0/projectB
maint/source/v2.0/projectA
maint/source/v2.0/projectB
etc

obviously, we could put a branch dir under 'source', and a branch/tag under each subproject too but that would become tricky if we needed to release 2 subprojects as a single change request (as we do quite often). Putting a tag subdir under the source dir would mean we tag everything, when only a single subproject got changed (doesn't fit with our requirement to track each subproject individually)

显然,我们可以在'source'下放置一个分支目录,在每个子项目下也可以放置一个分支/标签,但如果我们需要将2个子项目作为单个变更请求发布(我们经常这样做),那将会变得棘手。在源目录下放置一个标记子目录意味着我们标记所有内容,只有一个子项目被更改(不符合我们单独跟踪每个子项目的要求)

#1


We put all the projects related to a single app within one SVN Rep simply for the sake of ease of maintenance, centralizing the app's code base in one repository only and also ability to manage the interdependencies between different resources of the app.

我们将与单个应用程序相关的所有项目放在一个SVN Rep中仅仅是为了便于维护,仅将应用程序的代码库集中在一个存储库中,并且还能够管理应用程序的不同资源之间的相互依赖性。

we generally categorize our resources into different folders within trunk. that categorization is primarily based on the functional /modular grouping or layered grouping [DAL, BLL, GUI, etc.]. that is completely upto how you have structured the code. Hope this helps.

我们通常将资源分类到trunk中的不同文件夹中。该分类主要基于功能/模块化分组或分层分组[DAL,BLL,GUI等]。这完全取决于你如何构建代码。希望这可以帮助。

#2


The SVN Book has a good discussion on both approaches.

SVN Book对这两种方法都有很好的讨论。

In the end I would choose whatever feels more natural to repository users.

最后,我会选择对存储库用户更自然的东西。

Personally, I've favoured a single SVN trunk/tags/branches approach with all my actual code projects in their own folders inside those.

就个人而言,我更喜欢单个SVN主干/标签/分支方法,所有我的实际代码项目都在他们自己的文件夹中。

However, for a larger code-base (I've only managed 3-4 small projects which were part of a single solution), I would highly consider changing to a split approach.

但是,对于更大的代码库(我只管理了3-4个小项目,它们是单个解决方案的一部分),我会高度考虑改为拆分方法。

#3


I use both separate projects and combined projects depending on project size. For our large projects, each one is in a separate repository, and has independent build and deployment procedures. For our smaller projects we have a "tools" repository to contain them, with each sub-project as a subdirectory of the root.

我根据项目大小使用单独的项目和组合项目。对于我们的大型项目,每个项目都在一个单独的存储库中,并具有独立的构建和部署过程。对于我们较小的项目,我们有一个“工具”存储库来包含它们,每个子项目作为根的子目录。

I also maintain a "personal" repository where people can store their test programs one-off utilities, or other things that could benefit from source control and centralized backups, but does not belong as an independent project.

我还维护一个“个人”存储库,人们可以在其中存储他们的测试程序一次性实用程序,或其他可以从源代码控制和集中备份中受益的东西,但不属于独立项目。

#4


I use separate projects and combine them to form a solution through svn:externals.

我使用单独的项目并将它们组合起来,通过svn:externals形成一个解决方案。

#5


One app / module that is deployed independently per project. Using a single project makes it difficult to introduce release cycles if you ever find out you need Maven -ish dependency management with a module depending on stable implementations of other modules. It can also lead to people just using random useful-looking code from other apps directly instead of factoring it out to keep the dependency graph Sane (tm).

每个项目独立部署的一个应用程序/模块。如果您发现需要Maven -ish依赖关系管理与模块取决于其他模块的稳定实现,则使用单个项目会导致很难引入发布周期。它还可以导致人们直接使用来自其他应用程序的随机有用的代码,而不是将其分解以保持依赖关系图Sane(tm)。

You should do integration testing using proper test suites and CI practices at clearly defined , not by relying on half your code failing all of a sudden if one part breaks.

您应该使用适当的测试套件和明确定义的CI实践进行集成测试,而不是依靠一半代码在一个部件中断时突然失败。

Another problem with having a single uber-project is that it's rather onerous for git-svn users that only work on a single module.

拥有一个超级项目的另一个问题是,对于仅在单个模块上工作的git-svn用户而言,这是相当繁重的。

#6


Grow organically. Pre optimization is the root of all evil, Dijkstra once said. Also keep YANGI (you ain't gonna need it) in mind.

有机地成长。 Dijkstra曾经说过,预先优化是所有邪恶的根源。还要记住YANGI(你不需要它)。

Every application gets its own folder with trunk/tag/branches. If the a project within an application gets really big, then it gets pushed to it's own separate folder and can be linked to the application at build time (or even svn:externals).

每个应用程序都有自己的文件夹与trunk / tag / branches。如果应用程序中的项目变得非常大,那么它会被推送到它自己的单独文件夹,并且可以在构建时链接到应用程序(甚至是svn:externals)。

That said, if your project requirements are to develop a complex application written by 10 developers and you are the gatekeeper or build master then you can consider more complex alternatives.

也就是说,如果您的项目要求是开发由10位开发人员编写的复杂应用程序,并且您是守门人或构建主人,那么您可以考虑更复杂的替代方案。

#7


Keep separate SVN repositories for separate projects. The last thing you want is to have a Merge Day

为单独的项目保留单独的SVN存储库。你想要的最后一件事是合并日

#8


You might want to check out Subversion revision number across multiple projects.

您可能想要查看多个项目中的Subversion修订版号。

#9


Thanks for the input. I won't "choose" an answer because I think all have valuable points in them. Avoiding premature optimization does seem key as does keeping the layout as simple as possible for the time being. We are moving to a single project containing the apps because 90% of the time we release ALL together. Therefore, to complicate matters with a one-apps-per-project doesn't seem to make sense. Even when we go to maven it is likely that all maven artifacts for a given version will be made from the same branch. We can always change it later if need be using SVN history and fisheye to keep us sane.

感谢您的投入。我不会“选择”一个答案,因为我认为所有答案都有重要意义。避免过早优化似乎是关键,因为暂时保持布局尽可能简单。我们正在转向包含应用程序的单个项目,因为90%的时间我们一起发布ALL。因此,使用每个项目的一个应用程序复杂化事情似乎没有意义。即使我们去maven,给定版本的所有maven工件都可能来自同一个分支。如果需要使用SVN历史和鱼眼来保持我们的理智,我们总是可以在以后更改它。

We'll refactor the source layout just like we'd refactor the source. When a project starts to "smell bad" from a girth and dependency situation we'll break it up, but not before that. I'll probably use girth in time not girth in space: time to build & test, time to checkout. If I have a 1GB tree that I can checkout in < 10 minutes and build/test in < 30 minutes I don't really need to break it up unless I am required to release parts of it frequently.

我们将重构源布局,就像我们重构源代码一样。当一个项目从周长和依赖情况开始“闻起来很糟糕”时,我们会将其分解,但不会在此之前。我可能会及时使用周长而不是太空周长:建立和测试的时间,结账的时间。如果我有一个1GB的树,我可以在<10分钟内结账并在<30分钟内构建/测试我真的不需要打破它,除非我被要求经常释放它的一部分。

So, thanks for the input. It was really helpful in my framing the question for me team and evaluating options.

所以,感谢您的意见。这对我为团队和评估选项构建问题非常有帮助。

#10


there's no 'good' answer here, but I think there should be a distinction made between SVN repos that contain 1 or 2 projects, and others that contain 100.

这里没有“好”的答案,但我认为在包含1或2个项目的SVN repos与包含100个项目的其他项目之间应该有区别。

I maintain a SVN repo that was migrated from VSS, it has several hundred "projects" in it, none of them have been organised along the trunk/branch/tag structure (in fact I think that structure is really unnecessary and unhelpful after I've used SVN for a while, it certainly doesn't help when you have to tag 2 or 3 projects as a single change).

我维护了一个从VSS迁移的SVN仓库,它有几百个“项目”,没有一个沿着主干/分支/标签结构组织(实际上我觉得这个结构真的没必要,而且在我'之后无益。我已经使用了SVN一段时间,当你必须将2个或3个项目标记为单个更改时,它肯定没有用。

We maintain a project directory for all our maintained software, under that we have subdirs for configuration and another for source. Under those we have product version numbers - so effectively we are throwing away the concept of trunk, we only have tag directories - the highest number being the trunk (we have to do this as we have to support several versions of the projects simultaneously). Merging happens as needed, so if I update a bug in project A, version 3.0; I'll merge those changes to version 4.0 and v5.0.

我们为所有维护的软件维护一个项目目录,在该目录下我们有用于配置的子目录和用于源的另一个子目录。在那些我们有产品版本号的情况下 - 所以我们有效地抛弃了trunk的概念,我们只有标签目录 - 最高的数字是主干(我们必须这样做,因为我们必须同时支持多个版本的项目)。根据需要进行合并,因此如果我更新项目A中的错误,版本3.0;我将这些更改合并到版本4.0和v5.0。

If I were to do a repo with just 1 or 2 projects, I may be tempted to keep the branch/tag structure, but on the other hand - I'd probably keep the directories explicit in the main tree (assuming I didn't release often enough to tag regularly)(I use the revision number as a 'tag' BTW, and I store binaries in there. So if I need to get a particular old revision, I can grab the right binary from looking at the log)

如果我只用1或2个项目进行回购,我可能会想要保留分支/标记结构,但另一方面 - 我可能会在主树中保持目录显式(假设我没有经常发布以定期标记)(我使用版本号作为'标签'BTW,我在那里存储二进制文件。所以如果我需要获得特定的旧版本,我可以从查看日志中获取正确的二进制文件)

Its surprisingly easy to manage considering I have a 10Gb repo with a revnum currently up past 300,000 with lots of old code in there as well as newer. I would recommend the structure to others and will use it again.

考虑到我有一个10Gb的回购,目前有超过300,000的revnum,其中包含大量旧代码以及更新版本,因此它的管理非常容易。我会向其他人推荐这个结构,并会再次使用它。

Incidentally, one other reason tags dir wouldn't work for us is because we release every time there is a bug or change request, no matter how tiny. Our tags directory would be unmanageable after a while, this is why we use the revnum as a tag - we can associate it with the bug tracker to keep it more human readable too.

顺便说一句,标签dir对我们不起作用的另一个原因是因为我们每次都有错误或变更请求时发布,无论多么微小。我们的标签目录在一段时间后将无法管理,这就是为什么我们将revnum用作标签 - 我们可以将它与bug跟踪器相关联,以使其更具人性化。

So to summarise in rough, we have a directory structure like this where v1 and v2 are product versions:

总而言之,我们有一个像这样的目录结构,其中v1和v2是产品版本:

maint/source/v1.0/projectA
maint/source/v1.0/projectB
maint/source/v2.0/projectA
maint/source/v2.0/projectB
etc

obviously, we could put a branch dir under 'source', and a branch/tag under each subproject too but that would become tricky if we needed to release 2 subprojects as a single change request (as we do quite often). Putting a tag subdir under the source dir would mean we tag everything, when only a single subproject got changed (doesn't fit with our requirement to track each subproject individually)

显然,我们可以在'source'下放置一个分支目录,在每个子项目下也可以放置一个分支/标签,但如果我们需要将2个子项目作为单个变更请求发布(我们经常这样做),那将会变得棘手。在源目录下放置一个标记子目录意味着我们标记所有内容,只有一个子项目被更改(不符合我们单独跟踪每个子项目的要求)