Do I need to be a design patterns expert before I dive into Domain Driven Design? [closed] - domain-driven-design

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I have a copy of Head First Design Patterns and I read through a few of the patterns in there. Now is Domain driven design a substitute to the traditional design patterns or does it build upon it? If its the latter, do I need to be a Design patterns expert before I attempt to learn domain driven design? What is the recommended path to DDD?

I read the blue book [Evans], the red book [Vernon] and occasionally pop into this tag on StackOverflow.
The book by Evans is very high level in some aspects and covers more than just code. The book by Vernon covers the building blocks of DDD an item at a time, using examples from a fictitious software product as an example:
Domain-driven Design: Tackling Complexity in the Heart of Software
Implementing Domain-Driven Design
There's also the video:
Eric Evans: What I've learned about DDD since the book
As for design patterns, the DDD material refers to lots of design patterns. Some existing design patterns work very well with DDD. You can pick these up as you encounter them, you wont necessarily need to know them in advance. One thing to avoid when learning design patterns, is to not try and force their use, they have their uses but you see a lot of developers trying to force the use of newly learnt design patterns in places where they aren't required.

Just do it. Don't let any preconceived condition prevents you from starting to practice it.

This is a bit late answer, but i want to say that patterns are not some set-in-stone follow-to-the-letter ultimate solutions. They are generic approaches to generic problems, guidelines if you want.
In DDD you provide specific solution to specific problems. If you can recognize patterns in your implementation you will gain a bit deeper and more structured understanding. If you can see problems calling for some patterns, you will have possible approaches for solving it. But beware, looking at the problem solely through patterns might lead to suboptimal solutions.
Knowing and understanding patterns will help you convey knowledge about implementation details to other developer in more efficient manner.
Like "this is Unit of Work" instead of "this object holds references to objects we act upon in this transaction and tracks their state so we can commit all changes at once".
Other than that, it is more important that you understand and follow SOLID and DDD principles to build successful domain models.

Related

Object oriented modeling and UML for agile development [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 12 months ago.
Improve this question
UML has come into many projects with object-oriented programming and is widely taught in colleges. However, today many software projects use a more or less agile approach, avoiding up-front in-depth analysis and leading to many changes ("welcome change"). In contrast, creating correct and readable UML (class) diagrams is still time-consuming; hence the value of documenting the model is in practice often considered time waste, as it changes often.
Even autogenerated (from source code) diagrams are not solving the problem, as they cannot correctly resolve class relationships often have insufficient graph layouts and distracting extensions.
Can UML be used in an agile context in a way that avoids the overhead of frequent manual updates? Or are other lighter alternatives to UML more suitable in such a context?
UML can be used in a light way in an agile context. The key is simply to be clear about its purpose and what you expect from modeling in your project.
Class diagrams and sequence diagrams are proven to be good candidates for helping teams to discuss points of concerns. It can express clearly ideas that are not obvious in the code (or scattered across many source files).
Scott Ambler for example wrote a lot on agile modeling, based on UML. Of course, you will not use it for producing an exhaustive model with all classes and all properties. But you'd sketch the core with some relevant classes, and only a few properties that matter in the discussion (Ambler says "Just barely enough" modeling).
However, for architectural modeling (deployment diagrams and the like), UML requires a degree of precision that is not always possible in early stages. Here C4 models has established as a convenient and flexible alternative. But C4 relies on UML for the OOP design discussion. There is simply no alternative that allows to easily show classes and interaction between them, and that would be sufficiently widely known.
Conclusion: In an agile context, don't get misguided thinking that UML would require an exhaustive up-front design. Don't use it as for visual programming either, slavishly replicating details of the code. But use it as a communication tool to highlight key ideas and allow everyone to grasp the design and contribute productively.

Can user stories be used for requirement gathering in prototyping methodlogy? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am developing a project using prototyping methodology. However, since end users are involved, I am thinking of user stories for requirements gathering. I can see that user stories are generally associated with AGILE methodology. So can I use it in a project that involves prototyping methodology?
In my experience User stories are used to divide a major chunk of work into smaller parts from an end users point of view.
Similarly, it can be used in prototyping methodology to divide the functionality of the prototype into small parts, each from an end users point of view.
since end users are involved, I am thinking of user stories for requirements gathering.
In line with the previous answer by Surkeet, user stories are written from the perspective of the user. Having them written in their language may make the communication between your development team and the user(s) smoother and based on a common vocabulary. The answer to this question is that "it depends". It really depends on the nature of your project. If the details of the user story (i.e. as a , I would like to so that ) is good enough for you, you have good-enough communication with your customer, and the nature your development tolerates iterations, then maybe user stories alone would be a good tactic to document and communicate requirements. However, there are cases where documenting requirements in terms of user stories is not enough. An example of that would the pressing need to agree on the non-functional requirements (a.k.a. quality attributes). An example of theses requirements is reliability, performance, and security. Especially in very large/critical systems that may fit an agile methodology, having to formally express non-functional requirements is a must. This is arguable and may start technical wars as some people do use user stories to document non-functional requirements.
So can I use it in a project that involves prototyping methodology?
Using user stories, however, is not the only tactic that you could use to develop effective prototype. Yes, it can be used to trigger the first iteration of prototyping and maybe govern the iterations of prototyping, but again it is not the only way. One could complement prototyping with different tactics that fits agile methodologies well such as storyboarding. Think of storyboards as an interactive, comic-like, representation of a given interaction to achieve a certain user-defined goal. The great thing about them is that they are graphical (as opposed to narrated bullet points of a use-case scenario), making them a powerful illustration tools. Here is a short article about the subject (link).
Also, I would recommend not thinking about Agile as a package that comes with techniques that you have to follow. Tailor the process to your needs.

What makes Domain-Driven Design worthwhile? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
We are trying to apply Domain-Driven Design in our project. However, the modeling efforts are huge and somehow the modeling seems to conflict with agile principles as a lot of upfront design is done. On the other hand the actual benefit are diffuse or are rather longterm whereas the "requirements analysis / modeling overhead" felt is an acute and ongoing problem.
So, the question comes up: What makes Domain-Driven Design worthwhile?
What are the short-term benefits?
Aside from your experience (which I find very interesting though): Is there an undisputable, logical answer?
DDD - Continous Refactoring
I guess I'd clarify that Domain Driven Design doesn't call for a tonne of up front modelling - what it calls for is conversations with domain experts, knowledge crunching to gain an intuitive understanding of the domain through 'sensible sounding' use of the ubiquitous language, and continuous refinement of all of the above.
The value of the tactical patterns (aggregates, etc.) is not around getting the model perfect up front, but from structuring your application such that when you inevitably realize that there is a better way of expressing the domain in a model, you can iterate and incorporate your insights into the updated model.
So - in that sense, it is highly supportive of an agile approach.
The best reference for this is the source - "Part III Refactoring Toward Deeper Insight" of the Blue Book' by Eric Evans
I'd recommend not trying to 'waterfall' your model and then 'agile' your code - 'agile' both of them, and accept that you will be refactoring your code not just when you find a more elegant way of solving technical problems, but also when you find a more elegant way of modelling business problems.
Undisputable Logical Answer?
In terms of an "undisputable logical answer" - to be honest I'm not sure you'll find one. DDD is an approach that is applied differently by different people - it is not an algorithm that can be analysed for it's Big O complexity.
My experience is that programs with anemic models and business logic scattered through a collection of loosely related services struggle to iterate and incorporate deeper insights into the business requirements because changes to the rules can have unforeseeable repercussions throughout the system. They encourage systems where new requirements are satisfied by stuffing behavior into places it was never intended to go, and you end up having conversations that involve multiple layers of remembering that code using the word 'employee' kind of sometimes relates to requirements for 'students' and 'teachers'.
Concentrating the essence of each entity into a class, and exposing it's behavior behind intention revealing interfaces enables effective reasoning about the impact of changes, thus enabling continuous refactoring of the model - both as understanding grows and requirements change.
Edit - How to Pursuade Others
From your comment, I now understand your intent better - I misinterpreted the question that you were looking to be persuaded that DDD is worthwhile - rather you are looking for an argument to present to your team to persuade them that it is worthwhile!
Unfortunately that is more of a inter-personal question than a technical one, as people are often not persuaded by arguments once they are convinced they are on the right path.
Perhaps if you have time you could produce a proof of concept of some acceptance tests and domain models to illustrate the method using real concepts from your domain? You can then show how easily the tests and models can be evolved as understanding grows, and ideally demonstrate an insight gained by actively modeling the domain in code and exercising the model. This is key, I believe, as in my opinion, such insights can only be gained by actively doing, and will never be arrived at through meeting room navel gazing.
Are you creating executable models or paper? If you create (acceptance test-driven) executable models like in exploratory modeling, the overhead is practically zero

How often is UML diagramming used "in the real world?" [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Almost every one of my programming classes has made use of UML, but none have really explained when or where it might be used in a professional setting. Is it done for every single file in a project, or is there some rule of thumb of when you might want to use it? Also, is it more commonly done by hand (which I've always dreaded) or using some sort of generator?
This question is very good example of opinion-based and very broad question with no real problem to solve behind it and no one correct possible answer
Certainly in the amount of millions of software developers there are some who learned to use UML and do use it. And there are some who either did not learn to use UML or just don't use it for whatever reason
I recall that in the pre-agile era it was believed that no "big" software can be realized without thorough analysis and modeling phase and no "big" software contract can be signed if the business documents don't include some UML-style pictures
And in some countries it is still true and government-owned agencies declare what kind of documentation software contractor must provide, and for some of the requirements an UML picture is the good form
See also:
Wikipedia: Rational Unified Process (RUP)
Wikipedia: Software requirements specification
Programmers: Writing a Software Requirement Specification
So there are UML believers, UML skeptics and even UML haters, it depends on ... things.
I'm UML believer
and so is for example Mr. Kenji Hiranabe from Change Vision, Inc the company behind Astah UML modeling tool and he says
...Is modeling obsolete? Is UML dead? I don't think so. In this article...
as foreword to article Modeling in the Agile Age: What to keep next to Code to Scale Agile Teams
my favorite guideline is what The Guru said in an interview with Mark Collins-Cope for the Objective View magazine on Sep 12, 2014
Grady Booch, creator of the Unified Modelling Language (UML):
"The UML should be used to reason about alternatives. Put up some diagrams. Throw some use cases against it. Throw away those diagrams then write some code against you best decision. Repeat (and refactor)"
How you finally evaluate "..UML...commonly...real world.." depends on what you want to see and which software development best practices you adopt in your own work
It depends on your role, in most developer roles you will rarely, if ever, have to use it. I can see it being useful if you are designing something though, like a new database structure, or architecting a new system or application.
It can be useful for lead developers, architects, or IT managers in the design stages of the application for communicating ideas to the business folks as well as passing on a plan for the development team that will be building it out.

Newest Agile Design Methods for code construction [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Hallo everybody
Recently I've been reading the book:
"Agile software development, Principles, Patterns and Practices" by Bob Martin
The following (S.O.L.I.D) agile-design-principles are listed within the book:
Single Responsibility Principle
Open Closed Principle Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle
Because of the fact that this book quite old(2003), I have a question:
Are there any other newly developed principles besides the SOLID methods?? If yes, is there any book/site covering these new emerging principles with practical code examples that you could recommend to me??
Of course I can google for some of these.
However, in stackoverflow read and write many profis, so I would like to hear their opinion too :D
You may want to look at books such as Code Complete and Pragmatic Programmer as they also talk about some excellent development principles.
I like the Domain Driven Design approach from Eric Evans:
http://domaindrivendesign.org/
http://domaindrivendesign.org/books#DDD
As the SOLID approach you describe, DDD is mostly sound and clean Object Orientation guidelines. DDD focus especially on creating a design which match as much as possible with the business to be implemented in the system, rather than having it guided by the technology and/or the frameworks you use. This lead to great testable design, easy to refactor.
In support to DDD, I like the Hexagonal Architecture of Alistair Cockburn. It gives you great ideas about general design of Object Oriented systems:
http://alistair.cockburn.us/Hexagonal+architecture
A more advanced and innovative approach I am currently exploring is the theory of centers, but this is not yet really documented. A presentation about it:
http://www.dreamsongs.com/Files/NatureOfOrder.pdf
UncleBob's book is a SOLID start ;) I'd add his Clean Code to your reading list too. For actual code construction it is a great tome.
Kindness,
Dan
You can find further design principles at http://www.objectmentor.com, the author's / Object Mentor's homepage. They were written around the same time as SOLID, you can find most of them at http://www.objectmentor.com/resources/publishedArticles.html.
This list is not for design principles only, but also an explanation of OOP, Agile architecture, design and practices, it is based on patterns of mistakes and a regular pain from my real projects, including both books and online articles:
Software Developer / Architect Recommended Reading

Resources