You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Focus the problem
Generalize the problem (less contextual):
- Predisposition is more of a force than a problem.
- Modularization solves more problems in different contexts.
Detail further the effects of lack of modularization.
* Correct and expand the context
- Remove the lack of mandate because it might or not be the case.
- Remove the exclusion of legacy code. It is a clear use case.
- Making code modular doesn't take extra effort and time over the
alternatives.
+ Include advantages for documentation
* Organize forces
* Group in pro/con/neutral
* Turn Frequent turnover into a pro
* Explain impact opportunity for newbies
* Describe resulting context
Move some points from Solutions section to Resulting Context.
They describe effects of modularization, not actions to be taken
towards it.
* Reorganize solutions
1. Describe modularization as the main solution. The rest are secondary
actions to implement and/or support modularization as a practice.
2. Prepare (offer education) first
3. Then, decide to go for it
4. Finally take the first steps.
- Mitigating risk and fear of changes is a result, not an action.
- Providing incentives is questionable. Its benefits should suffice.
- Paralell labour moved to 'Resulting context' section already as
it is a result, not an action. Remove duplication.
---------
Co-authored-by: Sebastian Spier <[email protected]>
Co-authored-by: Mishari Muqbil <[email protected]>
Copy file name to clipboardExpand all lines: patterns/1-initial/modular-code.md
+51-34Lines changed: 51 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,54 +8,70 @@ The lack of modularization in the software architecture prevents reuseability, a
8
8
9
9
## Problem
10
10
11
-
Engineering does not want to spend the extra resources needed to develop modular components. This applies to managers and developers alike. As a result, fewer components end up being reused, leading to duplication of work.
11
+
With rare exceptions, monolithinc code is difficult to contribute to as it packs much functionality (much to read, much to grasp, much to test, much to review, and much to document). Finding slots and the right mood to attack big chunks of work is difficult.
12
+
13
+
The same functionality is reimplemented redundantly causing waste of unneeded re-design and re-development and duplicated mainteinance effort.
14
+
15
+
Sometimes the first problem causes the second, but it might also happen spontaneously.
12
16
13
17
## Context
14
18
15
-
* There is no corporate mandate for modularized code.
16
-
* This is a new product/new code, not a legacy product/code.
19
+
* There might be potentially reusable functionality buried in monolithic code. Legacy code tends to be less modular than new one.
17
20
* There is an available repository for sharing code.
18
-
* Making code modular takes extra effort and time to develop.
21
+
* Source code can be as useful as documentation on small enough pieces.
22
+
* Documentation needed for getting started using a small piece of code is easy to write.
19
23
* Time commitments might already have been made for customer deliveries (not changeable).
24
+
* The value of modularity is nearly invisible for end users.
20
25
21
26
## Forces
22
27
23
-
* There is a learning curve to writing code that can be reused.
24
-
* Extra documentation is required for reusable code.
25
-
* Some companies have a common components group that develops reusable code, but others feel that such components should be developed by those business lines that are using the components and a library of common components could be established.
26
-
* Developers might not know how to write modular code.
27
-
28
-
* Might be a fear that if not done properly, quality might be impacted.
29
-
* Developers might have no incentive to write modular code (due to their tight schedules and lack of a mandate).
30
-
* If there is frequent turnover of team members, modularization may not be a priority.
31
-
* You might be dealing with legacy systems (can't be simply refactored or rewritten).
32
-
* Requirements might be different for writing modular code.
* The value of modularity is nearly invisible for end users.
34
+
* In favor:
35
+
* Modularization mitigates risk and fear of quality degradation from accepting InnerSource contributions.
36
+
* Companies moving to use more open source code will appreciate modularity more over time.
37
+
* Code protected through reliable automated testing offers a chance for newcomers to safely have an impact by refactoring. Modularization is a powerful goal for refactoring. And refactoring usually drags additional benefits.
38
+
* Frequent turnover of team members speaks for modularization, as it helps newcomers to learn about the system at smaller bits.
39
+
* Neutral / Two-folded:
40
+
* Some companies have a common components group that develops reusable code, but others feel that such components should be developed by those business lines that are using the components and a library of common components could be established.
41
+
* Level of communication between teams can impact ability/inclination to modularize.
36
42
37
43
## Solutions
38
44
39
-
* Provide incentives to teams to invest in modular code. Modular code is far more reusable. This could work well for large teams when working on modularized projects; team members can focus on their smaller assigned tasks.
40
-
- Developers could get an opportunity to increase their influence in the organization.
41
-
- Modular code makes the pathway to open source smoother.
42
-
- Modular code facilitates division of labour (as required for work in larger teams, or as an open source project)
43
-
- Modular projects enable team members to focus on their own smaller assigned tasks.
44
-
- Modular code makes Agile implementation easier.
45
-
- Modular efforts increase autonomy and accountability for Engineers, which can raise satisfaction and quality.
46
-
* Select certain "success projects," teams that will develop reusable code and demonstrate the long term success. This can help motivate others (they see what is possible and what is in it for them). Transparency is critical.
47
-
* Offer education. Modular code is well-understood; there is a lot of literature in favor of this.
48
-
* Acknowledge and drive acceptance for the cost of modularization. Build time into the release schedule for this.
49
-
* Companies moving to use more open source code will appreciate modularity more over time.
50
-
* Mitigate risk and fear of quality degradation from accepting InnerSource contributions.
51
-
* Establish a checklist of elements to be checked off to classify a component as reusable.
52
-
- There could be requirements on tests, tools and documentation before considering a component as reusable
53
-
- Introduce refactoring as organic effort and strive for it to become part of the culture. Refactoring leads to more modular code and reduction of technical debt.
54
-
* Establish standards on testing methodology, labeling of repos.
45
+
Modular code is far more reusable. Decoupling functionality into smaller narrow-focused modules eases
46
+
and therefore promotes external contributions and onboarding of newcomers.
47
+
48
+
* Offer education.
49
+
* On why: Lack of modularity is technical debt. It increases costs but hides them by shifting these into the future.
50
+
* On how: Modular code is well-understood; there is a lot of literature in favor of this that can be used for training.
51
+
* Select certain "success projects", teams that have developed reusable code and can demonstrate the long term success. This can help motivate others, as they see what is possible and what is in it for them. Learning directly from other developers is critical.
52
+
* Introduce refactoring as an organic effort and strive for it to become part of the culture.
53
+
* Acknowledge and drive acceptance for the investment in modularization. Build time into the release schedule for this.
54
+
* Search for modularizable functionalities:
55
+
* Identify common functionalities and code blocks with potential for profitable modularity.
56
+
* Establish a checklist of elements to be checked off to classify a component as reusable.
57
+
There could be requirements on tests, tools and documentation before considering a component as reusable.
58
+
Establish standards on testing methodology, labeling of repos.
59
+
* Eat the elephant in small bites. Break modularization down into baby steps, like
60
+
1. Find internal would-be customers. Better ask them over guessing on your own.
61
+
1. Define decoupling scope and preferred decoupling methods.
62
+
1. Develop automated testing protection.
63
+
1. Document usage of modules.
64
+
1. Introduce semantic versioning.
65
+
1. Use a dependency management software such as pip, nuget, npm.
66
+
* More information and techniques are available from the book *[Working Effectively with Legacy Code](https://www.oreilly.com/library/view/working-effectively-with/0131177052/)* by Michael Feathers and *[Refactoring: Improving the Design of Existing Code](https://martinfowler.com/books/refactoring.html)* by Martin Fowler.
55
67
56
68
## Resulting Context
57
69
58
-
**Pattern Idea**: Time is spent making the shared code modular so it can be reused.
70
+
* Modular code facilitates division of parallel labor (as required for work in larger teams, or as an open source project).
71
+
* Modular projects enable team members to focus on their own smaller assigned tasks.
72
+
* Modular code helps Agile: For the same functionality, you'll need to change more bits, but the modularity helps to materialize sooner (earlier and more reliable validations) and to prioritize the most relevant bits (separate value from waste).
73
+
* Modular efforts increase autonomy and accountability for Engineers, which can raise satisfaction and quality.
74
+
* Modular code makes the pathway to InnerSource and open source smoother.
0 commit comments