Timeline for Java instanceof and Clean architecture
Current License: CC BY-SA 4.0
25 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 14, 2023 at 12:08 | answer | added | Ewan | timeline score: 0 | |
| Dec 24, 2021 at 11:06 | answer | added | Thomas Junk | timeline score: 0 | |
| Dec 23, 2021 at 12:43 | answer | added | user408067 | timeline score: 0 | |
| Dec 6, 2021 at 12:35 | answer | added | user406230 | timeline score: 1 | |
| Aug 4, 2021 at 7:32 | comment | added | Robert Bräutigam | @FilipMilovanović "It describes a generalized way of dividing up the system". This is exactly what I mean. It is not based on requirements, it is generic, i.e. technical. It defines "high" and "low" level based on whether it has anything to do with UI for example. This is also technical. A non-technical (i.e. business-relevant) division would say the "Amount" is higher level than "Balance". That is business-relevant. I'm not making a value judgement, it's just an observation. | |
| Aug 3, 2021 at 19:13 | comment | added | Filip Milovanović | @RobertBräutigam And you can't separate policies by how low/high-level they are without understanding the business rules of the problem domain and the business needs of the application (cause they either are the policies, or frame the lower level policies). | |
| Aug 3, 2021 at 19:01 | comment | added | Filip Milovanović | @RobertBräutigam "while CA tells you explicitly that you have to start with these technicalities" - no it does not, you just read it that way. It describes a generalized way of dividing up the system; it only really asks you to separate policies by how hi-level they are. It doesn't actually prescribe the number of layers (you can have more or less), doesn't actually require you to have controllers/presenters, the "input/output data" could be data structures or parameter lists, the "interactor" could be one class or 3 classes or just a function, and "entities" are just a role. | |
| Aug 3, 2021 at 15:01 | comment | added | JimmyJames | There may be justifications for that? Isn't this your design? Shouldn't you know why you have designed it this way? | |
| Aug 3, 2021 at 13:05 | comment | added | Robert Bräutigam | @FilipMilovanović / Laiv "Clean Architecture" is a completely technical construct. It promotes artificial components, objects, interfaces that have absolutely nothing to do with "business". I find it ironic that you're demanding more "business", while CA tells you explicitly that you have to start with these technicalities. You should be blaming CA not the OP. | |
| Aug 3, 2021 at 11:44 | answer | added | Joop Eggen | timeline score: 0 | |
| Aug 3, 2021 at 10:53 | comment | added | Laiv | I have to agree with @FilipMilovanović. It's a design flaw, not an issue related to the architecture (CA). Basically, you are failing at modelling abstractions, something hard to help you with if you say that the code above is a meaningless example. | |
| Aug 3, 2021 at 9:00 | history | tweeted | twitter.com/StackSoftEng/status/1422482387854823444 | ||
| Aug 3, 2021 at 6:36 | answer | added | Doc Brown | timeline score: 1 | |
| Aug 3, 2021 at 6:20 | history | edited | Shayan | CC BY-SA 4.0 |
added 1019 characters in body
|
| Aug 3, 2021 at 5:05 | comment | added | Shayan | @FilipMilovanović It's just an minimal example. I have not written all the business logics. Otherwise, My question would be too long. | |
| Aug 3, 2021 at 5:03 | comment | added | Shayan | @JimmyJames There may be many justifications for that. For example, To prevent redundancy, UI only submits the ids of the objects, and the ParentEntity must be consistent with the objects, so the repository retrieves the objects and checks if it is consistent with them, and only then persists the ParentEntity. | |
| Aug 3, 2021 at 4:59 | comment | added | Shayan | @DocBrown For all ParentEntities. | |
| Aug 2, 2021 at 20:39 | comment | added | Filip Milovanović |
But here are some general things you could look into, things that could be "code smells". SaveUseCase is doesn't look like a use case - it's more like a generic save service. It doesn't do anything that can be understood as meaningful on its own, it's just a data sink (single void method). Then, all it appears to do is entityRepository.save(list), so, why have the SaveUseCase class at all? Also, it's unclear why your AEntity extends ParentEntity. What is the design purpose of ParentEntity? Furthermore entities in CA are not database entities. 2/2
|
|
| Aug 2, 2021 at 20:39 | comment | added | Filip Milovanović | I think you are missing something, but I don't think anyone of us can tell you exactly what, because your question is expressed in terms of the mechanics, but doesn't explain what the business problem is. 1/2 | |
| Aug 2, 2021 at 20:38 | answer | added | JimmyJames | timeline score: 0 | |
| Aug 2, 2021 at 18:11 | answer | added | fnmps | timeline score: 2 | |
| Aug 2, 2021 at 14:53 | comment | added | JimmyJames |
Why does AEntity only have int ids for associated ParentEntity instances? Why doesn't it have references to the objects (or a way to get them)?
|
|
| Aug 2, 2021 at 12:44 | comment | added | Doc Brown |
What is the intended scope of EntityRepository? Is it intended to be repo for all kind of derivations of ParentEntity, knowing the whole inheritance hierarchy, or is it a repo intended just for dealing with AEntity objects? Or are you trying to implement it in a generic fashion for ParentEntitys, just in terms of virtual functions of this class?
|
|
| Aug 2, 2021 at 12:32 | answer | added | amon | timeline score: 3 | |
| Aug 2, 2021 at 12:10 | history | asked | Shayan | CC BY-SA 4.0 |