Comments (9)
Done -> fd3fd68
from java.
Older versions of the library used to silently ignore duplicate components, but I changed this behaviour a few months ago. Perhaps the easiest thing to do here is to add a flag (e.g. ignoreDuplicateComponents) onto the component finder strategy so that you can choose to ignore duplicate components, or not. Thoughts?
from java.
So I think the typical end goal for any user of a finder strategy would be to end up with a list of all the components they might care about, ideally with all of the metadata and data about that component that it is possible to discover.
In this particular case, I believe there isn't really any additional data to be discovered about a Type that will become a component even if it is discovered by two separate finder strategies.
There might be a small bit of additional metadata, depending on if the strategy sets particular tags, technologies, etc. on the components. I'm thinking about the Spring Component finders in particular, but that might happen in others as well. A hypothetical case I can think of would be a Spring Component getting annotated with the Structurizr @component annotation.
So, my preference would be to merge any metadata where it can be merged. If it can't be merged, such as a name or description, then we'd have to consider either "a last found wins" or a priority based strategy. I don't think anyone would seriously complain about the last found wins resolution, and it would probably be a lot easier to implement.
from java.
Perhaps the best way to deal with this is to allow people to customise what they want to do in the event that a duplicate component is found. I'm just adding some changes to support a pluggable strategy, of the form:
public interface DuplicateComponentStrategy {
void duplicateComponentFound(Component component, String name, String type, String description, String technology);
}
You could then provide an implementation that did anything you wanted, with the default behaviour to throw a DuplicateComponentFoundException
. Would that work for you?
from java.
Yes, I think that would work fine. I'm working on my patched version of the spring finder strategies to just add dupes as supporting types since that is the majority of the cases I'm hitting at the moment.
from java.
Hi, I'm running into a bunch of DuplicateComponentFoundExceptions - not sure why yet, still investigating - but setting my own DuplicateComponentStrategy has no effect.
The errors are a.o. about Spring Repositories.
I'm not familiar with the codebase, but I think that in method beforeFindComponents of SpringComponentFinderStrategy the setDuplicateComponentStrategy for each item of componentFinderStrategies ?
from java.
Thanks, I opened a new issue (#110) ... and pushed a fix that I think addresses it.
from java.
Hi, thanks for the fix! Any idea when you would push a new version to Maven Central?
from java.
You're welcome! I'm planning a release later this week.
from java.
Related Issues (20)
- Parameter names for Model.addPerson HOT 2
- Documentation lacking on Enterprise
- Documentation lacking on Location HOT 1
- Naming for Model.addSoftwareSystem
- Component.uses() generates null type safety warning HOT 6
- DSL <-> Java model implementation differences HOT 1
- Difference on codeElement level - no view generation
- Layout of relationships is reset when changing the description HOT 1
- Allow named colors HOT 5
- DeploymentNodes implied relationships HOT 1
- Named colours are case-sensitive
- Exporting workspace authored with structurizr java to dsl HOT 1
- Removal of documentation section (title)? HOT 1
- Validate uniqueness of a documentation section HOT 2
- Should ViewSet::getViews() return ModelView instead of View?
- Can this generate DSL?
- Views are not created automatically if non-English characters are used in software systems' names HOT 2
- Allow Relationship views to contain URLs, which then get used as links on dynamic views and sequence diagrams HOT 1
- Allow hiding of system boundary for container view
- Support for parent by template HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java.