Iterator versus Stream of Java 8

There’s lots of performance advice here, but sadly much of it is guesswork, and little of it points to the real performance considerations. @Holger gets it right by pointing out that we should resist the seemingly overwhelming tendency to let the performance tail wag the API design dog. While there are a zillion considerations that … Read more

DDD and MVC: Difference between ‘Model’ and ‘Entity’

Entity Entity means an object that is a single item that the business logic works with, more specifically those which have an identity of some sort. Thus, many people refer to ORM-mapped objects as entities. Some refer to as “entity” to a class an instance of which represents a single row in a database. Some … Read more

Where to put global rules validation in DDD

Most of the times it is best to place these kind of rules in Specification objects. You can place these Specifications in your domain packages, so anybody using your domain package has access to them. Using a specification, you can bundle your business rules with your entities, without creating difficult-to-read entities with undesired dependencies on … Read more

How are Value Objects stored in the database?

It’s ok to store Value Objects in a separate table, for the very reasons you’ve described. However, I think you’re misunderstanding Entities vs VOs – it’s not a persistence related concern. Here’s an example: Assume that a Company and Person both have the same mail Address. Which of these statements do consider valid? “If I … Read more

DDD – Persistence Model and Domain Model

Just think of it this way, the domain model should be dependent upon nothing and have no infrastructure code within it. The domain model should not be serializable or inherit from some ORM objects or even share them. These are all infrastructure concerns and should be defined separate from the domain model. But, that is … Read more

EF codefirst : Should I initialize navigation properties?

Collections: It doesn’t matter. There is a distinct difference between collections and references as navigation properties. A reference is an entity. A collections contains entities. This means that initializing a collection is meaningless in terms of business logic: it does not define an association between entities. Setting a reference does. So it’s purely a matter … Read more

Having Separate Domain Model and Persistence Model in DDD

Are there any reasons opinion 1) would be preferred to opinion 2) other than speeding up development and reusing code. Option 1 is just because of pure laziness and imagined increased development speed. It’s true that those applications will get version 1.0 built faster. But when those developers reach version 3.0 of the application, they … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)