92

I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app.

As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the package naming conventions that I see are as follows:

  1. Functional: Naming your packages according to their function architecturally rather than their identity according to the business domain. Another term for this might be naming according to 'layer'. So, you'd have a *.ui package and a *.domain package and a *.orm package. Your packages are horizontal slices rather than vertical.

    This is much more common than logical naming. In fact, I don't believe I've ever seen or heard of a project that does this. This of course makes me leery (sort of like thinking that you've come up with a solution to an NP problem) as I'm not terribly smart and I assume everyone must have great reasons for doing it the way they do. On the other hand, I'm not opposed to people just missing the elephant in the room and I've never heard a an actual argument for doing package naming this way. It just seems to be the de facto standard.

  2. Logical: Naming your packages according to their business domain identity and putting every class that has to do with that vertical slice of functionality into that package.

    I have never seen or heard of this, as I mentioned before, but it makes a ton of sense to me.

    1. I tend to approach systems vertically rather than horizontally. I want to go in and develop the Order Processing system, not the data access layer. Obviously, there's a good chance that I'll touch the data access layer in the development of that system, but the point is that I don't think of it that way. What this means, of course, is that when I receive a change order or want to implement some new feature, it'd be nice to not have to go fishing around in a bunch of packages in order to find all the related classes. Instead, I just look in the X package because what I'm doing has to do with X.

    2. From a development standpoint, I see it as a major win to have your packages document your business domain rather than your architecture. I feel like the domain is almost always the part of the system that's harder to grok where as the system's architecture, especially at this point, is almost becoming mundane in its implementation. The fact that I can come to a system with this type of naming convention and instantly from the naming of the packages know that it deals with orders, customers, enterprises, products, etc. seems pretty darn handy.

    3. It seems like this would allow you to take much better advantage of Java's access modifiers. This allows you to much more cleanly define interfaces into subsystems rather than into layers of the system. So if you have an orders subsystem that you want to be transparently persistent, you could in theory just never let anything else know that it's persistent by not having to create public interfaces to its persistence classes in the dao layer and instead packaging the dao class in with only the classes it deals with. Obviously, if you wanted to expose this functionality, you could provide an interface for it or make it public. It just seems like you lose a lot of this by having a vertical slice of your system's features split across multiple packages.

    4. I suppose one disadvantage that I can see is that it does make ripping out layers a little bit more difficult. Instead of just deleting or renaming a package and then dropping a new one in place with an alternate technology, you have to go in and change all of the classes in all of the packages. However, I don't see this is a big deal. It may be from a lack of experience, but I have to imagine that the amount of times you swap out technologies pales in comparison to the amount of times you go in and edit vertical feature slices within your system.

So I guess the question then would go out to you, how do you name your packages and why? Please understand that I don't necessarily think that I've stumbled onto the golden goose or something here. I'm pretty new to all this with mostly academic experience. However, I can't spot the holes in my reasoning so I'm hoping you all can so that I can move on.

Sourav Ghosh
  • 133,132
  • 16
  • 183
  • 261
Tim Visher
  • 12,786
  • 16
  • 58
  • 66
  • What I've heard so far seems to indicate that it's kind of a judgment call. However, most answers haven't focussed on the practical considerations. That's more what I'm looking for. Thanks for the help so far, though! – Tim Visher Feb 10 '09 at 20:25
  • I don't think it's a judgment call. First dividing by layer, then by functionality is definitely the way to go. I am updating my answer. – eljenso Feb 13 '09 at 20:35
  • @eljenso: tell that to Eclipse guys :) In eclipse, first division is to "features", which are units of deployments and also functionality. Inside "feature", there are "plugins", which are usually divided by layer -- but plugins within same "feature" must always be deployed together. If you have only single deployment unit, then dividing by layer first and only then by functionality may make sense though. With multiple deployment units, you don't want to deploy just presentation layer -- you want additional piece of functionality. – Peter Štibraný Feb 17 '11 at 06:47
  • I have a specific question concerning the business layer of an application, what should be the naming convention? – Bionix1441 Oct 07 '20 at 07:14

15 Answers15

34

For package design, I first divide by layer, then by some other functionality.

There are some additional rules:

  1. layers are stacked from most general (bottom) to most specific (top)
  2. each layer has a public interface (abstraction)
  3. a layer can only depend on the public interface of another layer (encapsulation)
  4. a layer can only depend on more general layers (dependencies from top to bottom)
  5. a layer preferably depends on the layer directly below it

So, for a web application for example, you could have the following layers in your application tier (from top to bottom):

  • presentation layer: generates the UI that will be shown in the client tier
  • application layer: contains logic that is specific to an application, stateful
  • service layer: groups functionality by domain, stateless
  • integration layer: provides access to the backend tier (db, jms, email, ...)

For the resulting package layout, these are some additional rules:

  • the root of every package name is <prefix.company>.<appname>.<layer>
  • the interface of a layer is further split up by functionality: <root>.<logic>
  • the private implementation of a layer is prefixed with private: <root>.private

Here is an example layout.

The presentation layer is divided by view technology, and optionally by (groups of) applications.

com.company.appname.presentation.internal
com.company.appname.presentation.springmvc.product
com.company.appname.presentation.servlet
...

The application layer is divided into use cases.

com.company.appname.application.lookupproduct
com.company.appname.application.internal.lookupproduct
com.company.appname.application.editclient
com.company.appname.application.internal.editclient
...

The service layer is divided into business domains, influenced by the domain logic in a backend tier.

com.company.appname.service.clientservice
com.company.appname.service.internal.jmsclientservice
com.company.appname.service.internal.xmlclientservice
com.company.appname.service.productservice
...

The integration layer is divided into 'technologies' and access objects.

com.company.appname.integration.jmsgateway
com.company.appname.integration.internal.mqjmsgateway
com.company.appname.integration.productdao
com.company.appname.integration.internal.dbproductdao
com.company.appname.integration.internal.mockproductdao
...

Advantages of separating packages like this is that it is easier to manage complexity, and it increases testability and reusability. While it seems like a lot of overhead, in my experience it actually comes very natural and everyone working on this structure (or similar) picks it up in a matter of days.

Why do I think the vertical approach is not so good?

In the layered model, several different high-level modules can use the same lower-level module. For example: you can build multiple views for the same application, multiple applications can use the same service, multiple services can use the same gateway. The trick here is that when moving through the layers, the level of functionality changes. Modules in more specific layers don't map 1-1 on modules from the more general layer, because the levels of functionality they express don't map 1-1.

When you use the vertical approach for package design, i.e. you divide by functionality first, then you force all building blocks with different levels of functionality into the same 'functionality jacket'. You might design your general modules for the more specific one. But this violates the important principle that the more general layer should not know about more specific layers. The service layer for example shouldn't be modeled after concepts from the application layer.

eljenso
  • 16,789
  • 6
  • 57
  • 63
  • "Advantages of separating packages like this is that it is easier to manage complexity, and it increases testability and reusability." You really don't go into the reasons why this is so. – Turing Feb 18 '11 at 17:59
  • 2
    You don't go into the reasons why it *isn't* so. But anyway... the rules for organizing are fairly clear and straightforward, so it reduces complexity. It is more testable and reusable because of the organization itself. Everyone can try it out, and afterwards we can agree or disagree. I briefly explain some of the disadvantages of the vertical approach, implicitly giving reasons why I think the horizontal approach is easier. – eljenso Feb 18 '11 at 19:27
  • 8
    [This article](http://www.javapractices.com/topic/TopicAction.do?Id=205) explains quite nicely why it is better to use _package-by-feature_ instead of _package-by-layer_. – Tom Apr 27 '13 at 18:51
  • @eljenso "You don't go into the reasons why it isn't so", trying to shift the burden of proof? I think the article posted by Tom explains very nicely why package-by-feature is better and I'm having a hard time taking "I don't think it's a judgment call. First dividing by layer, then by functionality is definitely the way to go" seriously. – pka Sep 02 '13 at 15:00
19

I find myself sticking with Uncle Bob's package design principles. In short, classes which are to be reused together and changed together (for the same reason, e.g. a dependency change or a framework change) should be put in the same package. IMO, the functional breakdown would have better chance of achieving these goals than the vertical/business-specific break-down in most applications.

For example, a horizontal slice of domain objects can be reused by different kinds of front-ends or even applications and a horizontal slice of the web front-end is likely to change together when the underlying web framework needs to be changed. On the other hand, it's easy to imagine the ripple effect of these changes across many packages if classes across different functional areas are grouped in those packages.

Obviously, not all kinds of software are the same and the vertical breakdown may make sense (in terms of achieving the goals of reusability and closeability-to-change) in certain projects.

Buu
  • 49,745
  • 5
  • 67
  • 85
  • Thanks, this is very clear.As I said in the question, I feel like the number of times you would swap out technologies is far less than you would shift around vertical slices of functionality. Has this not been your experience? – Tim Visher Feb 10 '09 at 19:59
  • It's not just about technologies. Point #1 of your original post only makes sense if the vertical slices are independent applications/services communicating with each other via some interface (SOA, if you will). more below... – Buu Feb 11 '09 at 09:06
  • Now as you move into the detail of each of those fine-grained app/service which has its own gui/business/data, I can hardly imagine that changes in a vertical slice, be it about technology, dependency, rule/workflow, logging, security, UI style, can be completely isolated from other slices. – Buu Feb 11 '09 at 09:06
  • I would be interested in your feedback on [my answer](http://stackoverflow.com/questions/533102/what-strategy-do-you-use-for-package-naming-in-java-projects-and-why/18792438#18792438) – i3ensays Sep 13 '13 at 18:01
  • @BuuNguyen The link to the package design principles is broken. – johnnieb May 25 '16 at 15:15
5

There are usually both levels of division present. From the top, there are deployment units. These are named 'logically' (in your terms, think Eclipse features). Inside deployment unit, you have functional division of packages (think Eclipse plugins).

For example, feature is com.feature, and it consists of com.feature.client, com.feature.core and com.feature.ui plugins. Inside plugins, I have very little division to other packages, although that's not unusual too.

Update: Btw, there is great talk by Juergen Hoeller about code organization at InfoQ: http://www.infoq.com/presentations/code-organization-large-projects. Juergen is one of architects of Spring, and knows a lot about this stuff.

Peter Štibraný
  • 32,463
  • 16
  • 90
  • 116
  • I don't quite follow. Usually you might see com.apache.wicket.x where x is either functional or logical. I usually don't see com.x. I guess you're saying that you would go with a com.company.project.feature.layer structure? Do you have reasons? – Tim Visher Feb 10 '09 at 19:46
  • Reason is that "com.company.project.feature" is unit of deployment. At this level, some features are optional, and can be skipped (i.e. not deployed). However, inside feature, things are not optional, and you usually want them all. Here it makes more sense to divive by layers. – Peter Štibraný Feb 10 '09 at 20:36
4

Both functional (architectural) and logical (feature) approaches to packaging have a place. Many example applications (those found in text books etc.) follow the functional approach of placing presentation, business services, data mapping, and other architectural layers into separate packages. In example applications, each package often has only a few or just one class.

This initial approach is fine since a contrived example often serves to: 1) conceptually map out the architecture of the framework being presented, 2) is done so with a single logical purpose (e.g. add/remove/update/delete pets from a clinic). The problem is that many readers take this as a standard that has no bounds.

As a "business" application expands to include more and more features, following the functional approach becomes a burden. Although I know where to look for types based on architecture layer (e.g. web controllers under a "web" or "ui" package, etc.), developing a single logical feature begins to require jumping back and forth between many packages. This is cumbersome, at the very least, but its worse than that.

Since logically related types are not packaged together, the API is overly publicized; the interaction between logically related types is forced to be 'public' so that types can import and interact with each other (the ability to minimize to default/package visibility is lost).

If I am building a framework library, by all means my packages will follow a functional/architectural packaging approach. My API consumers might even appreciate that their import statements contain intuitive package named after the architecture.

Conversely, when building a business application I will package by feature. I have no problem placing Widget, WidgetService, and WidgetController all in the same "com.myorg.widget." package and then taking advantage of default visibility (and having fewer import statements as well as inter-package dependencies).

There are, however, cross-over cases. If my WidgetService is used by many logical domains (features), I might create a "com.myorg.common.service." package. There is also a good chance that I create classes with intention to be re-usable across features and end up with packages such as "com.myorg.common.ui.helpers." and "com.myorg.common.util.". I may even end up moving all these later "common" classes in a separate project and include them in my business application as a myorg-commons.jar dependency.

i3ensays
  • 2,804
  • 3
  • 19
  • 23
4

Most java projects I've worked on slice the java packages functionally first, then logically.

Usually parts are sufficiently large that they're broken up into separate build artifacts, where you might put core functionality into one jar, apis into another, web frontend stuff into a warfile, etc.

Ben Hardy
  • 1,739
  • 14
  • 16
  • What might that look like? domain.company.project.function.logicalSlice? – Tim Visher Feb 10 '09 at 20:18
  • pretty much! e.g. d.c.p.web.profiles, d.c.p.web.registration, d.c.p.apis, d.c.p.persistence etc. generally works pretty well, your mileage may vary. depends also if you're using domain modeling - if you have multiple domains, you may want to split by domain first. – Ben Hardy Feb 10 '09 at 23:19
  • I personally prefer to the opposite, logical then functional. apples.rpc, apples.model and then banana.model, banana.store – mP. Feb 13 '09 at 21:47
  • There is more value in being able to group all the apple stuff together than grouping all the web stuff together. – mP. Feb 13 '09 at 21:48
3

Packages are to be compiled and distributed as a unit. When considering what classes belong in a package, one of the key criteria is its dependencies. What other packages (including third-party libraries) does this class depend on. A well-organized system will cluster classes with similar dependencies in a package. This limits the impact of a change in one library, since only a few well-defined packages will depend on it.

It sounds like your logical, vertical system might tend to "smear" dependencies across most packages. That is, if every feature is packaged as a vertical slice, every package will depend on every third party library that you use. Any change to a library is likely to ripple through your whole system.

erickson
  • 265,237
  • 58
  • 395
  • 493
  • Ah. So one thing that doing horizontal slices does is shield you from actual upgrades in the libraries you're using. I think you're right that the vertical slices smear every dependency your system has across every package. Why is this such a big deal? – Tim Visher Feb 10 '09 at 20:02
  • For a "feature", it's not such a big deal. They tend to be more volatile and have more dependencies anyway. On the other hand, this "client" code tends to have low re-usability. For something you intend to be a reusable library, isolating clients from every little change is a great investment. – erickson Feb 10 '09 at 23:37
3

I personally prefer grouping classes logically then within that include a subpackage for each functional participation.

Goals of packaging

Packages are after all about grouping things together - the idea being related classes live close to each other. If they live in the same package they can take advantage of package private to limit visibility. The problem is lumping all your view and persitance stuff into one package can lead to a lot of classes being mixed up into a single package. The next sensible thing to do is thus create view, persistance, util sub packages and refactor classes accordingly. Underfortunately protected and package private scoping does not support the concept of the current package and sub package as this would aide in enforcing such visibility rules.

I see now value in separation via functionality becase what value is there to group all the view related stuff. Things in this naming strategy become disconnected with some classes in the view whilst others are in persistance and so on.

An example of my logical packaging structure

For purposes of illustration lets name two modules - ill use the name module as a concept that groups classes under a particular branch of a pacckage tree.

apple.model apple.store banana.model banana.store

Advantages

A client using the Banana.store.BananaStore is only exposed to the functionality we wish to make available. The hibernate version is an implementation detail which they do not need to be aware nor should they see these classes as they add clutter to storage operations.

Other Logical v Functional advantages

The further up towards the root the broader the scope becomes and things belonging to one package start to exhibit more and more dependencies on things belonging to toher modules. If one were to examine for example the "banana" module most of the dependencies would be limited to within that module. In fact most helpers under "banana" would not be referenced at all outside this package scope.

Why functionality ?

What value does one achieve by lumping things based on functionality. Most classes in such a case are independent of each other with little or no need to take advantage of package private methods or classes. Refactoring them so into their own subpackages gains little but does help reduce the clutter.

Developer changes to the system

When developers are tasked to make changes that are a bit more than trivial it seems silly that potentially they have changes that include files from all areas of the package tree. With the logical structured approach their changes are more local within the same part of the package tree which just seems right.

mP.
  • 18,002
  • 10
  • 71
  • 105
  • "When developers [...] files from all areas of the package tree." You are right when you say this seems silly. Because this is exactly the point of proper layering: changes *do not* ripple through the entire structure of the application. – eljenso Feb 13 '09 at 22:52
  • Thanks for the advice. I'm not sure I'm understanding you clearly. I believe you're trying to argue for Logical packages, I'm not exactly clear why. Could you try to make your answer a little clearer, possibly rewording? Thanks! – Tim Visher Feb 19 '09 at 22:14
2

I totally follow and propose the logical ("by-feature") organization! A package should follow the concept of a "module" as closely as possible. The functional organization may spread a module over a project, resulting in less encapsulation, and prone to changes in implementation details.

Let's take an Eclipse plugin for example: putting all the views or actions in one package would be a mess. Instead, each component of a feature should go to the feature's package, or if there are many, into subpackages (featureA.handlers, featureA.preferences etc.)

Of course, the problem lies in the hierarchical package system (which among others Java has), which makes the handling of orthogonal concerns impossible or at least very difficult - although they occur everywhere!

thSoft
  • 21,755
  • 5
  • 88
  • 103
2

It depends on the granularity of your logical processes?

If they're standalone, you often have a new project for them in source control, rather than a new package.

The project I'm on at the moment is erring towards logical splitting, there's a package for the jython aspect, a package for a rule engine, packages for foo, bar, binglewozzle, etc. I'm looking at having the XML specific parsers/writers for each module within that package, rather than having an XML package (which I have done previously), although there will still be a core XML package where shared logic goes. One reason for this however is that it may be extensible (plugins) and thus each plugin will need to also define its XML (or database, etc) code, so centralising this could introduce problems later on.

In the end it seems to be how it seems most sensible for the particular project. I think it's easy to package along the lines of the typical project layered diagram however. You'll end up with a mix of logical and functional packaging.

What's needed is tagged namespaces. An XML parser for some Jython functionality could be tagged both Jython and XML, rather than having to choose one or the other.

Or maybe I'm wibbling.

JeeBee
  • 17,476
  • 5
  • 50
  • 60
  • I don't fully understand your point. I think what you're saying is that you should just do what makes the most sense for your project and for you that's logical with a little functional thrown in. Are there specific practical reasons for this? – Tim Visher Feb 10 '09 at 20:22
  • As I said, I'm going to have plugins to augment in-built functionality. A plugin is going to have to be able to parse and write its XML (and eventually into the DB) as well as provide functionality. Therefore do I have com.xx.feature.xml or com.xx.xml.feature? The former seems neater. – JeeBee Feb 11 '09 at 10:15
2

I try to design package structures in such a way that if I were to draw a dependency graph, it would be easy to follow and use a consistent pattern, with as few circular references as possible.

For me, this is much easier to maintain and visualize in a vertical naming system rather than horizontal. if component1.display has a reference to component2.dataaccess, that throws off more warning bells than if display.component1 has a reference to dataaccess. component2.

Of course, components shared by both go in their own package.

levand
  • 8,440
  • 3
  • 41
  • 54
  • As I understand you then, you would advocate for the vertical naming convention. I think this is what a *.utils package is for, when you need a class across multiple slices. – Tim Visher Feb 10 '09 at 19:48
1

It is an interesting experiment not to use packages at all (except for the root package.)

The question that arises then, is, when and why it makes sense to introduce packages. Presumably, the answer will be different from what you would have answered at the beginning of the project.

I presume that your question arises at all, because packages are like categories and it's sometimes hard to decide for one or the other. Sometimes tags would be more appreciate to communicate that a class is usable in many contexts.

user53682
  • 81
  • 4
1

I would personally go for functional naming. The short reason: it avoids code duplication or dependency nightmare.

Let me elaborate a bit. What happens when you are using an external jar file, with its own package tree? You are effectively importing the (compiled) code into your project, and with it a (functionally separated) package tree. Would it make sense to use the two naming conventions at the same time? No, unless that was hidden from you. And it is, if your project is small enough and has a single component. But if you have several logical units, you probably don't want to re-implement, let's say, the data file loading module. You want to share it between logical units, not have artificial dependencies between logically unrelated units, and not have to choose which unit you are going to put that particular shared tool into.

I guess this is why functional naming is the most used in projects that reach, or are meant to reach, a certain size, and logical naming is used in class naming conventions to keep track of the specific role, if any of each class in a package.

I will try to respond more precisely to each of your points on logical naming.

  1. If you have to go fishing in old classes to modify functionalities when you have a change of plans, it's a sign of bad abstraction: you should build classes that provide a well defined functionality, definable in one short sentence. Only a few, top-level classes should assemble all these to reflect your business intelligence. This way, you will be able to reuse more code, have easier maintenance, clearer documentation and less dependency issues.

  2. That mainly depends on the way you grok your project. Definitely, logical and functional view are orthogonal. So if you use one naming convention, you need to apply the other one to class names in order to keep some order, or fork from one naming convention to an other at some depth.

  3. Access modifiers are a good way to allow other classes that understand your processing to access the innards of your class. Logical relationship does not mean an understanding of algorithmic or concurrency constraints. Functional may, although it does not. I am very weary of access modifiers other than public and private, because they often hide a lack of proper architecturing and class abstraction.

  4. In big, commercial projects, changing technologies happens more often than you would believe. For instance, I have had to change 3 times already of XML parser, 2 times of caching technology, and 2 times of geolocalisation software. Good thing I had hid all the gritty details in a dedicated package...

Varkhan
  • 16,601
  • 5
  • 31
  • 24
  • 1
    Forgive me if I'm wrong, but it sounds to me like you're more talking about developing a framework that's intended to be used by many people. I think the rules change between that type of development and developing end user systems. Am I wrong? – Tim Visher Feb 10 '09 at 20:15
  • I think for common classes used by many of the vertical slices, it makes sense to have something like a `utils` package. Then, any classes that need it can simply depend on that package. – Tim Visher Feb 10 '09 at 20:17
  • Once again, size matters: when a project becomes big enough, it needs to be supported by several people, and some kind of specialization will occur. To ease interaction, and prevent mistakes, segmenting the project in parts becomes quickly necessary. And the utils package will soon become ginormous! – Varkhan Feb 10 '09 at 20:37
0

From a purely practical standpoint, java's visibility constructs allow classes in the same package to access methods and properties with protected and default visibility, as well as the public ones. Using non-public methods from a completely different layer of the code would definitely be a big code smell. So I tend to put classes from the same layer into the same package.

I don't often use these protected or default methods elsewhere - except possibly in the unit tests for the class - but when I do, it is always from a class at the same layer

Bill Michell
  • 8,240
  • 3
  • 28
  • 33
  • Isn't it something of the nature of multi-layered systems to always be dependent on the next layer down? For instance, the UI depends on your services layer which depends on your domain layer, etc. Packaging vertical slices together seems to shield against excessive inter-package dependencies, no? – Tim Visher Feb 10 '09 at 20:08
  • I don't use protected and default methods nearly ever. 99% are either public or private. Some exceptions: (1) default visibility for methods used only by unit tests, (2) protected abstract method which is used only from the abstract base class. – Esko Luontola Feb 13 '09 at 22:27
  • 1
    Tim Visher, dependencies between packages are not a problem, as long as the dependencies always point in the same direction and there are no cycles in the dependency graph. – Esko Luontola Feb 13 '09 at 22:29
0

It depends. In my line of work, we sometimes split packages by functions (data access, analytics) or by asset class (credit, equities, interest rates). Just select the structure which is most convenient for your team.

quant_dev
  • 6,181
  • 1
  • 34
  • 57
  • Is there any reason for going either way? – Tim Visher Feb 10 '09 at 19:41
  • Splitting by asset class (more generally: by business domain) makes it easier for the new people to find their way through the code. Splitting by function is good for encapsulation. For me, "package" access in Java is akin to a "friend" in C++. – quant_dev Feb 12 '09 at 07:45
  • @quant_dev I disagree with "..by function is good for encapsulation". I think you mean the complete opposite is true. Also, don't just pick out of "convenience". There is a case for each (see my answer). – i3ensays Oct 04 '13 at 00:19
-3

From my experience, re-usability creates more problems than solving. With the latest & cheap processors and memory, I would prefer duplication of code rather than tightly integrating in order to reuse.

  • 6
    Code reuse is not about the price of hardware but about code maintenance costs. – user2793390 Feb 28 '14 at 19:59
  • 1
    Agree, but fixing something in a simple module shouldn't effect entire code. What maintenance costs are you talking about? – Raghu Kasturi Apr 25 '14 at 20:52
  • 1
    A bug fix in a module should affect the whole application. Why would you want to fix the same bug multiple times? – user2793390 May 08 '14 at 15:48
  • Have you had to maintain that code of yours years after you wrote it? I curse those who came before me that took such a lackadaisical approach to computer programming. Spending my time to fix your code multiple times due to duplicate is both inefficient and annoying.I had to work on my own code 18 years after I wrote it and every ameturish mistake I made just made life that much harder for me. redundancy is one of those terrible mistakes that I paid for in the end. – David Rector Dec 16 '20 at 05:09