|
-
Aug 15th, 2023, 04:24 PM
#8
Re: Constructor Style
Personally I tend to prefer the factory methods for a couple of reasons...
Firstly, I find them a lot more obvious when reading the code.
Secondly, although it is legal for a constructor to throw am exception, it never seems quite right; a method that throws an exception seems a lot more natural.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|