๐๏ธ ๐๐ก๐๐ซ๐ ๐ฒ๐จ๐ฎ๐ซ ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ๐ ๐๐๐จ๐ฎ๐ญ ๐๐๐๐ ? ๐๐๐๐ is a pattern initially articulated by Greg Young. Essentially, it revolves around the idea that updating information can employ a different model than reading information. While this separation can be advantageous in specific scenarios, it's important to be cautious, as, for the majority of systems, implementing CQRS introduces a potentially risky level of complexity. The main idea of CQRS is to introduce a split of the conceptual model into separate models for update and display. Many implementations involve the Mediator Pattern and database duplication in addition. Here's some ๐๐ฒ๐ป๐ฒ๐ณ๐ถ๐ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ฏ ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows the read and writes operations to be scaled independently, since they are handled by separate models. This means that read-heavy applications can be scaled more easily without impacting the write operations, and vice versa. ๐ฏ ๐ฃ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ By optimizing each model for its specific use case, CQRS can lead to significant performance improvements. The query model can be designed for fast data retrieval, while the Command model can be optimized for consistency and durability. ๐ฏ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ผ๐ณ ๐๐ผ๐ป๐ฐ๐ฒ๐ฟ๐ป๐ CQRS provides a clear separation of concerns, making the codebase easier to understand and maintain. Developers can more easily reason about how changes to the codebase will affect the overall system. ๐ฏ ๐๐น๐ฒ๐ ๐ถ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows each model to evolve independently, since they are not tightly coupled. This means that changes to one model can be made without impacting the other model. โ ๏ธ ๐๐ป๐ฐ๐ฟ๐ฒ๐ฎ๐๐ฒ๐ฑ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐ ๐ถ๐๐ CQRS can increase the complexity of the application, since there are now two distinct models to maintain. This can lead to a steeper learning curve for developers and a more complex codebase overall. โ ๏ธ ๐๐๐ฒ๐ป๐๐๐ฎ๐น ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐ Since the Command and Query models are separate, there may be a delay between when data is written and when it becomes available for reading. This delay is known as eventual consistency and must be accounted for in the application design. โ ๏ธ ๐๐ฎ๐๐ฎ ๐๐๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป Since the Command and Query models are separate, there may be some duplication of data between them. This can lead to increased storage requirements and may require additional effort to keep the data in sync. #cqrs #design #pattern #programming #software #softwareengineering Source : Romain Ottonelli Dabadie
SmartIPlaceโs Post
More Relevant Posts
-
SDET at Infosys | Full Stack.NET Developer | Youtuber | Hustler | An avid learner and obsessive seeker of IT knowledge | I make things.
๐๏ธ ๐๐ก๐๐ซ๐ ๐ฒ๐จ๐ฎ๐ซ ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ๐ ๐๐๐จ๐ฎ๐ญ ๐๐๐๐ ? ๐๐๐๐ is a pattern initially articulated by Greg Young. Essentially, it revolves around the idea that updating information can employ a different model than reading information. While this separation can be advantageous in specific scenarios, it's important to be cautious, as, for the majority of systems, implementing CQRS introduces a potentially risky level of complexity. The main idea of CQRS is to introduce a split of the conceptual model into separate models for update and display. Many implementations involve the Mediator Pattern and database duplication in addition. Here's some ๐๐ฒ๐ป๐ฒ๐ณ๐ถ๐ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ฏ ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows the read and writes operations to be scaled independently, since they are handled by separate models. This means that read-heavy applications can be scaled more easily without impacting the write operations, and vice versa. ๐ฏ ๐ฃ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ By optimizing each model for its specific use case, CQRS can lead to significant performance improvements. The query model can be designed for fast data retrieval, while the Command model can be optimized for consistency and durability. ๐ฏ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ผ๐ณ ๐๐ผ๐ป๐ฐ๐ฒ๐ฟ๐ป๐ CQRS provides a clear separation of concerns, making the codebase easier to understand and maintain. Developers can more easily reason about how changes to the codebase will affect the overall system. ๐ฏ ๐๐น๐ฒ๐ ๐ถ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows each model to evolve independently, since they are not tightly coupled. This means that changes to one model can be made without impacting the other model. โ ๏ธ ๐๐ป๐ฐ๐ฟ๐ฒ๐ฎ๐๐ฒ๐ฑ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐ ๐ถ๐๐ CQRS can increase the complexity of the application, since there are now two distinct models to maintain. This can lead to a steeper learning curve for developers and a more complex codebase overall. โ ๏ธ ๐๐๐ฒ๐ป๐๐๐ฎ๐น ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐ Since the Command and Query models are separate, there may be a delay between when data is written and when it becomes available for reading. This delay is known as eventual consistency and must be accounted for in the application design. โ ๏ธ ๐๐ฎ๐๐ฎ ๐๐๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป Since the Command and Query models are separate, there may be some duplication of data between them. This can lead to increased storage requirements and may require additional effort to keep the data in sync. #cqrs #design #pattern #programming #software #softwareengineering ___________ If you found this post helpful ๐ Like ๐ Repost ๐
To view or add a comment, sign in
-
๐๏ธ ๐๐ก๐๐ซ๐ ๐ฒ๐จ๐ฎ๐ซ ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ๐ ๐๐๐จ๐ฎ๐ญ ๐๐๐๐ ? CQRS is an intriguing pattern I often saw misuse or misunderstood, let's streamline the concept. ๐๐๐๐ is a pattern initially articulated by Greg Young. Essentially, it revolves around the idea that updating information can employ a different model than reading information. While this separation can be advantageous in specific scenarios, it's important to be cautious, as, for the majority of systems, implementing CQRS introduces a potentially risky level of complexity. The main idea of CQRS is to introduce a split of the conceptual model into separate models for update and display. Many implementations involve the Mediator Pattern and database duplication in addition. Here's some ๐๐ฒ๐ป๐ฒ๐ณ๐ถ๐ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ฏ ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows the read and writes operations to be scaled independently, since they are handled by separate models. This means that read-heavy applications can be scaled more easily without impacting the write operations, and vice versa. ๐ฏ ๐ฃ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ By optimizing each model for its specific use case, CQRS can lead to significant performance improvements. The query model can be designed for fast data retrieval, while the Command model can be optimized for consistency and durability. ๐ฏ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ผ๐ณ ๐๐ผ๐ป๐ฐ๐ฒ๐ฟ๐ป๐ CQRS provides a clear separation of concerns, making the codebase easier to understand and maintain. Developers can more easily reason about how changes to the codebase will affect the overall system. ๐ฏ ๐๐น๐ฒ๐ ๐ถ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows each model to evolve independently, since they are not tightly coupled. This means that changes to one model can be made without impacting the other model. โ ๏ธ ๐๐ป๐ฐ๐ฟ๐ฒ๐ฎ๐๐ฒ๐ฑ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐ ๐ถ๐๐ CQRS can increase the complexity of the application, since there are now two distinct models to maintain. This can lead to a steeper learning curve for developers and a more complex codebase overall. โ ๏ธ ๐๐๐ฒ๐ป๐๐๐ฎ๐น ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐ Since the Command and Query models are separate, there may be a delay between when data is written and when it becomes available for reading. This delay is known as eventual consistency and must be accounted for in the application design. โ ๏ธ ๐๐ฎ๐๐ฎ ๐๐๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป Since the Command and Query models are separate, there may be some duplication of data between them. This can lead to increased storage requirements and may require additional effort to keep the data in sync. #cqrs #design #pattern #programming #software #softwareengineering
To view or add a comment, sign in
-
๐๏ธ ๐๐ก๐๐ซ๐ ๐ฒ๐จ๐ฎ๐ซ ๐ญ๐ก๐จ๐ฎ๐ ๐ก๐ญ๐ ๐๐๐จ๐ฎ๐ญ ๐๐๐๐ ? ๐๐๐๐ is a pattern initially articulated by Greg Young. Essentially, it revolves around the idea that updating information can employ a different model than reading information. While this separation can be advantageous in specific scenarios, it's important to be cautious, as, for the majority of systems, implementing CQRS introduces a potentially risky level of complexity. The main idea of CQRS is to introduce a split of the conceptual model into separate models for update and display. Many implementations involve the Mediator Pattern and database duplication in addition. Here's some ๐๐ฒ๐ป๐ฒ๐ณ๐ถ๐ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ฏ ๐ฆ๐ฐ๐ฎ๐น๐ฎ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows the read and writes operations to be scaled independently, since they are handled by separate models. This means that read-heavy applications can be scaled more easily without impacting the write operations, and vice versa. ๐ฏ ๐ฃ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ By optimizing each model for its specific use case, CQRS can lead to significant performance improvements. The query model can be designed for fast data retrieval, while the Command model can be optimized for consistency and durability. ๐ฏ ๐ฆ๐ฒ๐ฝ๐ฎ๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐ผ๐ณ ๐๐ผ๐ป๐ฐ๐ฒ๐ฟ๐ป๐ CQRS provides a clear separation of concerns, making the codebase easier to understand and maintain. Developers can more easily reason about how changes to the codebase will affect the overall system. ๐ฏ ๐๐น๐ฒ๐ ๐ถ๐ฏ๐ถ๐น๐ถ๐๐ CQRS allows each model to evolve independently, since they are not tightly coupled. This means that changes to one model can be made without impacting the other model. โ ๏ธ ๐๐ป๐ฐ๐ฟ๐ฒ๐ฎ๐๐ฒ๐ฑ ๐๐ผ๐บ๐ฝ๐น๐ฒ๐ ๐ถ๐๐ CQRS can increase the complexity of the application, since there are now two distinct models to maintain. This can lead to a steeper learning curve for developers and a more complex codebase overall. โ ๏ธ ๐๐๐ฒ๐ป๐๐๐ฎ๐น ๐๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐ Since the Command and Query models are separate, there may be a delay between when data is written and when it becomes available for reading. This delay is known as eventual consistency and must be accounted for in the application design. โ ๏ธ ๐๐ฎ๐๐ฎ ๐๐๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป Since the Command and Query models are separate, there may be some duplication of data between them. This can lead to increased storage requirements and may require additional effort to keep the data in sync. #cqrs #design #pattern #programming #software #softwareengineering ___________ If you found this post helpful ๐ Like ๐ Repost ๐ Follow : Romain Ottonelli Dabadie Stay tuned ๐
To view or add a comment, sign in
-
It is hard to build a #CI workflow for #MachineLearning projects. There are some key challenges..BUT...It is possible. Unlike traditional software, ML applications do not only impact by a change in the code but also the data on which the model is trained. Another key challenge is regarding quality control. In software projects, the unit/integration/regression tests ensure whether a change is safe to be integrated and delivered. If all tests are passed, it does, otherwise, it doesnโt. This isnโt suitable with an ML model due to several reasons. First, the mapping between input and output can be dynamic as some types of ML models have a non-deterministic behavior. Second, the input of ML models could be in an extremely complicated format such as a high-dimensional vector or an image. Generating the input like the way developers normally do when they write tests will be very inefficient and exhausting(if possible). Well, for data versioning, there are open-source tools available that can be used. One the author suggested is Data Version Control(DVC). The quality control is trickier because it isnโt a passed-or-failed question anymore. But keeping everything in mind, here is a proposed CI pipeline for ML applications. โค Developer branches out from main. โค Developer makes changes and runs experiments on a local machine(or a remote server) until get the desired result. โค Developer creates a PR targeting the main branch. โค CI server re-runs the experiment branch to ensure reproducibility. โค CI server compares the performance metrics with the main branch and reports back to the PR page on GitHub so other members can review it. โค If approved, the code is then merged to main. โค CI server reruns the experiment again but this time the model is pushed to the remote storage for future deployment as well as a performance report for comparison. Read the full article here: https://lnkd.in/gh3svbg5
To view or add a comment, sign in
-
-
"Doing CQRS the wrong way is easy" proceed to misunderstand CQRS completely. CQRS is about something other than databases, despite being a fundamentally shared misunderstanding across the industry. You can still do CQRS with the same database. CQRS is not a system design concern. CQRS is about data modeling and data structures if you wish. Does CQRS play well with Event-sourced systems? Most definitely. But because I am a good driver, it doesn't make me a car! Two completely different things that play nice together, but they are not required to go along. #KnowledgeIsNotUnderstanding
Doing CQRS+ES the wrong way is easy. CQRS stands for command query responsability segregation and it is a way of separating reads from a database from writes to it. ES stands for event sourcing. Together they offer some technical opportunities: * put the business logic on the write path, resulting in a less diluted domain model * optimize the read path for speed * using caches and cache invalidation becomes easier What often happens though is that the development team makes the events (for ES) too fine grained. Example of a fine grained event stream: * LastNameChanged * StreetChanged * StreetNumberChanged * AddressAdditionChanged What is actually happening when those database fields have changed? Where is the business value? The answer: nowhere. What you need to do instead is to apply systems thinking, or like I call it - use-case thinking. And issue only one appropriate event, or multiple appropriate events in case of use-case composition. Example of a better event stream: * ProspectiveCustomerMarried And from there, the event can be picked up and acted on according to business needs. This kind of thinking leads to many benefits: * a crisper, less diluted domain model * a domain model that is easier to test * simpler code, which is easier to understand It also leads to better products because you foster product thinking also in the minds of the developers, but that's just one of the side effects. I want to clarify: sometimes really just the street number changes, because the user mistyped his address upon registration. The point is: the business needs to send a selection of baby products to potential new mothers, not to anyone making typos. By focusing more on business needs, you end up with a better architecture, simpler code, systems thinking and an overall better product. Advice: talk to and empathize more with the "devil", the business people. You gain an important tool - systems thinking - a tool you can use to grow your technical prowess. #domaindrivendesign #softwarearchitecture #cqrs #microservices #testdrivendevelopment
To view or add a comment, sign in
-
Strategic Azure Solutions Architect | Generative AI & MLOps Innovator | Data Architect Visionary | OpenAI | Azure DevOps | Terraform | Bicep | 6 Sigma Certified | 3x Azure Certified
Understanding Publisher-Subscriber pattern ๐ When to use this pattern โ ๐ Also called: Pub/sub messaging. ๐ ๐ฐ It is basically a behavioral design pattern used in software engineering. It is a way to establish one-to-many dependencies between objects, such that when one object (the publisher or subject) changes its state, all its dependents (subscribers or observers) are notified and updated automatically. ๐ข Publisher (Subject): This is the object that maintains a list of subscribers (observers) and notifies them when its state changes. The publisher provides methods for subscribing and unsubscribing observers, as well as a mechanism to notify all subscribers about changes in its state. ๐ข Subscriber (Observer): These are the objects that are interested in the state changes of the publisher. Subscribers register with the publisher to receive notifications. When the publisher's state changes, it notifies all registered subscribers, and they can react to the change. ๐ข Broker: A mechanism for copying each message from the input channel to the output channels for all subscribers interested in that message. This operation is typically handled by an intermediary such as a message broker or event bus. ๐ฆ Use this pattern when: โ An application needs to broadcast information to a significant number of consumers. โ An application needs to communicate with one or more independently-developed applications or services, which may use different platforms, programming languages, and communication protocols. โ An application can send information to consumers without requiring real-time responses from the consumers. โ The systems being integrated are designed to support an eventual consistency model for their data. โ An application needs to communicate information to multiple consumers, which may have different availability requirements or uptime schedules than the sender. ๐ซ This pattern might not be useful when: ๐ An application has only a few consumers who need significantly different information from the producing application. ๐ An application requires near real-time interaction with consumers. โป Keep in mind that there are also variations of this pattern, like the "event-driven" or "listener" patterns, which implement similar concepts but with some differences in their implementations. ๐ฆ Please comment the issues and considerations to implement this pattern and follow me for more such content. #ajaykumar #azure #azurearchitect #business #DataArchitect #dataengineering
To view or add a comment, sign in
-
-
Doing CQRS+ES the wrong way is easy. CQRS stands for command query responsability segregation and it is a way of separating reads from a database from writes to it. ES stands for event sourcing. Together they offer some technical opportunities: * put the business logic on the write path, resulting in a less diluted domain model * optimize the read path for speed * using caches and cache invalidation becomes easier What often happens though is that the development team makes the events (for ES) too fine grained. Example of a fine grained event stream: * LastNameChanged * StreetChanged * StreetNumberChanged * AddressAdditionChanged What is actually happening when those database fields have changed? Where is the business value? The answer: nowhere. What you need to do instead is to apply systems thinking, or like I call it - use-case thinking. And issue only one appropriate event, or multiple appropriate events in case of use-case composition. Example of a better event stream: * ProspectiveCustomerMarried And from there, the event can be picked up and acted on according to business needs. This kind of thinking leads to many benefits: * a crisper, less diluted domain model * a domain model that is easier to test * simpler code, which is easier to understand It also leads to better products because you foster product thinking also in the minds of the developers, but that's just one of the side effects. I want to clarify: sometimes really just the street number changes, because the user mistyped his address upon registration. The point is: the business needs to send a selection of baby products to potential new mothers, not to anyone making typos. By focusing more on business needs, you end up with a better architecture, simpler code, systems thinking and an overall better product. Advice: talk to and empathize more with the "devil", the business people. You gain an important tool - systems thinking - a tool you can use to grow your technical prowess. #domaindrivendesign #softwarearchitecture #cqrs #microservices #testdrivendevelopment
To view or add a comment, sign in
-
Back End Developer Asp core & Senior SQL Server DBA & Developer | Replication |Backup & Recovery | Query Optimization | Committed to optimizing database performance and scalability
Doing CQRS+ES the wrong way is easy. CQRS stands for command query responsibility segregation and it is a way of separating reads from a database from writes to it. ES stands for event sourcing. Together they offer some technical opportunities: * put the business logic on the write path, resulting in a less diluted domain model * optimize the read path for speed * using caches and cache invalidation becomes easier What often happens though is that the development team makes the events (for ES) too fine grained. Example of a fine grained event stream: * LastNameChanged * StreetChanged * StreetNumberChanged * AddressAdditionChanged What is actually happening when those database fields have changed? Where is the business value? The answer: nowhere. What you need to do instead is to apply systems thinking, or like I call it - use-case thinking. And issue only one appropriate event, or multiple appropriate events in case of use-case composition. Example of a better event stream: * ProspectiveCustomerMarried And from there, the event can be picked up and acted on according to business needs. This kind of thinking leads to many benefits: * a crisper, less diluted domain model * a domain model that is easier to test * simpler code, which is easier to understand It also leads to better products because you foster product thinking also in the minds of the developers, but that's just one of the side effects. I want to clarify: sometimes really just the street number changes, because the user mistyped his address upon registration. The point is: the business needs to send a selection of baby products to potential new mothers, not to anyone making typos. By focusing more on business needs, you end up with a better architecture, simpler code, systems thinking and an overall better product. Advice: talk to and empathize more with the "devil", the business people. You gain an important tool - systems thinking - a tool you can use to grow your technical prowess. #domaindrivendesign #softwarearchitecture #cqrs #microservices #testdrivendevelopment
To view or add a comment, sign in
-
-
Distinguished Software Engineer, Agile/Technical Coach, Podcast/Videocast Co-Host - The Mob Mentality Show
AGGREGATE in Action: Establishing Object Boundaries in Domain-Driven Design "...how do we know where an object made up of other objects begins and ends? In any system with persistent storage of data, there must be a scope for a transaction that changes data, and a way of maintaining the consistency of the data (that is, maintaining its invariants). Databases allow various locking schemes, and tests can be programmed. But these ad hoc solutions divert attention away from the model, and soon you are back to hacking and hoping. In fact, finding a balanced solution to these kinds of problems calls for deeper understanding of the domain, this time extending to factors such as the frequency of change between the instances of certain classes. We need to find a model that leaves high-contention points looser and strict invariants tighter. Although this problem surfaces as technical difficulties in database transactions, it is rooted in the modelโin its lack of defined boundaries. A solution driven from the model will make the model easier to understand and make the design easier to communicate. As the model is revised, it will guide our changes to the implementation. Schemes have been developed for defining ownership relationships in the model. The following simple but rigorous system, distilled from those concepts, includes a set of rules for implementing transactions that modify the objects and their owners. First we need an abstraction for encapsulating references within the model. An AGGREGATE is a cluster of associated objects that we treat as a unit for the purpose of data changes. Each AGGREGATE has a root and a boundary. The boundary defines what is inside the AGGREGATE. The root is a single, specific ENTITY contained in the AGGREGATE." โ Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software https://lnkd.in/gj3Dxcg #ddd #domaindrivendesign #refactoring #extremeprogramming #modernagile #agility #tdd #testdrivendevelopment #legacycode #continuousimprovement #maintainability #softwarequality #codequality #softwaredesign #lean
To view or add a comment, sign in
-
-
Code Smells: "Why is it bad?" and "How to fix it?" CODE SMELL: Middle man ๐ค๐จ๐ค The middle man is a class that has several methods that act as passthrough ๐ methods (they delegate the call to a method of one of the class' dependencies), without adding โโ any meaningful logic on top of it. CODE SMELL: The long parameter list ๐ The long parameter list code smell ๐ happens when method signatures require long lists of parameters. They may include, among other things, flag ๐ฉ parameters, which are a specially bad ๐ pattern. Flag parameters are used solely to determine which conditional path the method must execute, and make it much harder to figure out the method's overall behavior and intention. CODE SMELL: Knowledge duplication ๐๐ Knowledge duplication happens when the same codified knowledge is found in multiple places. The focus is on knowledge, rather than only on code. It will be inevitable to have similar code parts, and it's not always the best strategy to unify them. If they represent different pieces of knowledge, it's not wrong to keep them separate. If, however, they represent the same unit of knowledge (for example, code to read a file or to parse HTTP responses is copied in multiple places), then duplication is harmful. CODE SMELL: Primitive obsession ๐ฑ It happens when developers avoid creating their own fundamental types to deal with domain behavior or complex logic (for example, currency ๐ช, telephone numbers โ๏ธ, addresses๐ฌ), and rely too much on primitives. This does not leverage any of the principles of information hiding and encapsulation and can result in very poor ๐maintainability. CODE SMELL: Speculative generality ๐ฎ This code smell happens when we add functionality that isn't really needed but we believe will be needed in the future ๐ฎ. It often takes place in the form of unused data (parameters, fields in objects, columns in the database schema, among others), unused methods, and unnecessary classes. CODE SMELL: Long method Long functions are not bad per se. Functions and classes that do more than one thing (and are, as a consequence, long) are bad ๐. This smell is about jamming ๐ป different responsibilities into the same entity; therefore the "multitasker" name rather than just "long function". CODE SMELL: Feature Envy ๐ It happens when a certain function within a module needs to call ๐ functions from other modules too often to complete its functionality. This often happens when functions are spread across ๐ multiple modules, indicating that the code has low ๐ cohesion. #code #smell #programming https://lnkd.in/eSkC6rfa
To view or add a comment, sign in
๐ช Proud husband & dad | ๐ป Software Engineer | .NET Enthusiast
5moThanks for sharing