What's the difference between UML-Modeling and UML-design - uml

What's the difference between UML-Modeling and UML-Design? Or is it the same concept?
Thank you.

It's the same thing. Both refer to planning out your app (and documenting it) using UML.

Not really, even when both are part of the Structural Model (aim to model the static structure of the scenario), they use different objects.
The Domain Model instances are real-world objects. It is concerned with the problem domain and attempts to create a useful working model of the domain in which you are creating a solution for.
On the other hand, Design Model instances are software objects, which may be technology frameworks, databases, user interfaces, etc. you are using to get working software. You can say that Design Model is inspired by the Domain Model.

Related

DDD vs Anemic Domain Model

Could you please tell me what is the difference between the model Anemic Domain Model and the DDD? what is the most used nowadays ? which model is relevent when using an application the spring framework (spring data ...)?
See Martin Fowler, 2003.
The basic symptom of an Anemic Domain Model is that at first blush it looks like the real thing. There are objects, many named after the nouns in the domain space, and these objects are connected with the rich relationships and structure that true domain models have. The catch comes when you look at the behavior, and you realize that there is hardly any behavior on these objects, making them little more than bags of getters and setters.
The anemic domain model is really just a procedural style design, exactly the kind of thing that object bigots like me (and Eric) have been fighting since our early days in Smalltalk
the problem with anemic domain models is that they incur all of the costs of a domain model, without yielding any of the benefits.
Anemic Domain Model is a bad thing - it's a poorly implemented DDD Domain Model where the domain objects contain little or no business logic. All the logic is in other services.

How to make the best of an Anemic Domain Model given no other choice

So I started my 2nd developer job after spending 10 years at my first company and not really feeling I earned the title of a senior developer. It was java development but we were working with an anemic domain model and the application in my opinion was a huge difficult-to-test mess. Unfortunately the code base that I'm working with now is exactly the same and I recently had another interview where the interviewer described their Hibernate model as being light weight and just containing setters getters as well. So it appears this is quite common across the industry.
There's plenty of articles describing the anemic domain model as an anti-pattern and also some articles where it is described as perfectly fine for simple systems. But I haven't seen any examples of making the best out of working with a large enterprise system with an ADM.
Has anyone had experience with this? Are there any best practices for creating a loosely coupled system that contains unit tests that are readable and actually valuable? I really want to take pride in my work but am losing hope.
Edit:
To the developers that advocate business logic being contained in services:
how do you limit the dependencies on other services within each service? i.e. OrderCancelService needs CustomerAccountService and PaymentService and RefundCalculatorService and RewardsAdjustmentService, etc This tends to lead to several mock objects in tests making tests way too tied into implementation
how do you limit the number of parameters in each service's method? Since everything needs to be passed around and objects don't operate on their own data, this seems to lead to very large and confusing method signatures
Do you apply tell, don't ask principle to service objects? I see a lot of services that return values which are then used by the calling service to make decisions in execution flow.
You may consider your persistence model, which you now think about as the anemic domain model, as what it is - the persistence model for your domain model state.
If you do that, you probably can create a real domain model, which will have its state stored inside the persistence model objects (State pattern). Then, you can have your logic inside this new domain model. Reading your comment above, I would say you can convert your "manager/service" classes to state machines, you can call them aggregates if they match with transaction boundaries, and have their state in POJOs persisted by Hibernate as it is done now.

Suitable diagramming type and tool for a model based on DevExpress Domain Components

I'm busy prototyping a training management app using the DevExpress eXpressApp framework & Domain Components. This paradigm uses interfaces to specify domain entities, with default implementation logic generated at runtime, so that I can effectively enjoy multiple inheritance in my business entities.
I'm curious as to what sort of diagram I could use here to communicate my design assumptions to my client, without requiring me to build and deploy too frequently merely to confirm my assumptions etc. Hopefully fellow SO users familiar with this framework and it being used like I am doing can shed some light on this.
I felt that your question is a duplicate to Design and Modeling for DexExpress eXpressApp Framework. Basically, you will be able to model individual domain components using built-in Visual Studio modeling tools. It works pretty well with interfaces. Probably, you can also build a custom modeling solution based on an open source Liekhus ADO.NET Entity Data Model XAF Extensions tool.
Finally, since you are using XAF (and I believe you are also a DevExpress customer), I suggest you contact our Support Team to get fast and guaranteed assistance on XAF or any other DevExpress products.
You can model with a class diagram but what is generated at run time can not be modeled. I mean that for example if you have a model then you use the Model Driven Development in order to generate a code from your model then the generated code is not anymore your model but only the code like your run time classes.
Hope this help.

.NET Domain Driven Design and CSLA.NET

In Eric Evans' Domain Driven Design approach, would it be a good idea to use Rocky Lhotka's CSLA.NET for designing Business Entities for Domain Layer?
Looks like we can do that.
It's been a while since I read the CSLA book, but I do recall that it has support for a N-tier model that allows you to remote your domain objects. While interesting and maybe even useful in some cases, I'd be afraid the added complexity would not be worth it. Personally I would stick with a POCO domain model with an unobtrusive ORM like NHibernate unless my requirements dictated something more complicated.

When to use domain driven development and database driven 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 3 years ago.
The community reviewed whether to reopen this question 7 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Can anybody have good answer when should be database driven development be used and when should domain driven development be used. These both development approach have their importance in their respected areas. But I am not so clear which approach is appropriate in what type of situation. Any recommendation?
First for some background, Martin Fowler actually described three different "patterns" in his book Patterns of Enterprise Arcitecture. Transaction Script, Active Record and Domain Model. DDD uses the domain model pattern for the overall architecture and describes a lot of practices and patterns to implement and design this model.
Transaction script is an architecture where you don't have any layering. The same piece of code reads/writes the database, processes the data and handles the user interface.
Active Record is one step up from that. You split off your UI, your business logic and data layer still live together in active record objects that are modeled after the database.
A domain model decouples the business logic that lives in your model from your data-layer. The model knows nothing about the database.
And now we come to the interesting part:
The cost of this added separation is of course extra work. The benefits are better maintainability and flexibility.
Transaction script is good when you have few or no business rules, you just want to do data-entry and have no verification steps or all the verification is implemented in the database.
Active record adds some flexibility to that. Because you decouple your UI you can for example reuse the layer beneath it between applications, you can easilly add some business rules and verification logic to the business objects. But because these are still tightly coupled to the database changes in the datamodel can be very expensive.
You use a domain model when you want to decouple your business logic from the database. This enables you to handle changing requirements easier. Domain Driven Design is a method to optimally use this added flexibility to implement complex solutions without being tied to a database implementation.
Lots of tooling makes data-driven solutions easier. In the microsoft space it is very easy to visually design websites where all the code lives right behind the web-page. This is a typical transaction script solution and this is great to easilly create simple applications. Ruby on rails has tools that make working with active record objects easier. This might be a reason to go data-driven when you need to develop simpler solutions. For applications where behaviour is more important than data and it's hard to define all the behaviour up front DDD is the way to go.
I've asked a similar question: Where do I start designing when using O/R mapping? Objects or database tables?
From the answers I got I would say: Unless you have concrete reason to use database driven development, use domain driven development.
Think of it this way.
The problem domain exists forever. Your class definitions will reflect the eternal features of the domain.
The relational database is today's preferred persistence mechanism. At some point, we'll move past this to something "newer", "better", "different". The database design is merely one implementation; it reflects a solution architecture more than the problem domain.
Consequently, it's domain first. Classes reflect the problem domain and the universal truths. Relational database and ORM come second and third. Finally, fill in other stuff around the model.
As a side-note to mendelt's post, I feel there is a fourth pattern: one that is layered, separates busines logic from persistence and storage, yet uses no "entities", or "busines objects". A half way point, if you will, between Transaction/Action script and DDD.
In a good deal of the systems I've worked on, the persistence layer (repositories) used SqlClient directly and returned datasets to a calling service. The services performed decisions and compiled views which were sent to the user, through the controller. You migth consider the service layer a business model, and you'd be right, but it wasn't a "domain" model in the DDD sense. Still, ALL business logic occured in that one layer, period. Each layer had it's job. The views displayed data, the controllers determined views, the persistence layer handled storage, and the services worked in-between controllers and persistence.
The point is this: DDD is an approach to defining a business through Ul, tests, and code. It is not about entities, value objects and aggregates. Those things are just by-products of the OOP purists approach to DDD.
Just more thoughts for your consideration.
For complex business models, I prefer a mix of ActiveRecord and DDD. The domain objects know how to save themselves and data actions are done against a repository (nHibernate can act as a generic repository, if you look at a repository as something that exposes data to the model as a collection). The business logic resides in the domain entities, and even some encapsulation of value types can be accomplished, although only when there is a business need. Some implementations of DDD favor removing all public setters and only modifying entities through methods. I'm not a fan of that implementation unless there is a very good business need.
It seems to me that this implementation gives you the ease of use of ActiveRecord and the business logic encapsulation of DDD.
Domain Driven Development is surely the way to go. it makes more sense and adds flexibility.

Resources