Quote Originally Posted by Efitap View Post
...
If this forum is not for giving advice, but only solve school assignments, then I apologize
I have got most of your points before I typed my post but as you had written 'never' - you didn't explain at this time that there is a difference between domain classes and Value objects I felt a need to be a bit provocatve.

The main point in my post is still learning gradient and overwhelming students. by simple giving tooo much information to people with obviously no experience. I also wouldn't talk to a young apprentiece who wants to learn repairing a TV about complicated techniques in this electronics like PAL recognition or Quad modulation in his first days. The student may take his hat and run away. Believe me - even good information can be really too much. An example:
My son studies IT and I once asked him about a database problem. He knows my level of experience and by that he thought he could talk to me like he would talk with fellow students forgetting I have a practical but no mathematical theorethical background in this. In the late 60th when I ended school there was no such thing like datase theorie at technical school. After half an hour of information I was totally confused and had given up. All information was per sure correct good info, but it was simple too much.

So I'm always looking to the knowingness level of a person when answering a post and trying to give just the needed information.

What should a youngster who just has learned about classes and done some simple examples in school (where normally only primitives are used as properties ) think when just another one comes and tells him: 'Never use primitives as properties ! '

I personally would have been confused in that position.

Another point is that the name of this is 'primitive obsession' and an obsession would it be if a person feels the urgent need to do something.

Sorry IMHO always person can go the other way and becoming to get 'Objects Obession' programmers. Believe me in about 30 years of programming I have seen so much ideas about how a good program should be done and they have been coming and going, this is a field of permanent changes and we all always have to learn this one and to forget that one ( which maybe was a good practice for years ), so in my opinion this is unfortunatly also acommercial aspect of programming costs, so we all permanent have to decide which 'best practices' to use and which are to overdone for a project.
I have done programs that have 100.000 and more lines and never had a problem that an supplierId was used instead of a productID only because both are int32 values. To differ here we simple have the system of talking names, so this is not a cogent example that really shows me the needs of 'never' using an primitive.
More security because the compiler will show you an error. ?
Have you ever had an error because an object was forgot to initialize ? You may get secure so you cannot use the wrong ID in your example, but whats if you simple forget to initialize your value ? In my world you simple can overdo everything and sorry some things are going into that direction sometimes.
Refraction of code and reuseability was always a theme as long as we are doing programming. A balanced use of such things like wrapping a primitive, especially when there is an additional benefit like validation tests and all that is a very good technique, no daubt, but only and ever - IMHO No. All in live what is going to excessive and exclusive at least will not be survival. there is nothing which is
'Only , 'Exclusive' or 'Always' and 'Ever' in this world. Exceptions are the salt in the soup in this world