Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 11622

PHP is a widely-used, general-purpose scripting language that is especially suited for web development.

2 votes

Setting properties inside of a class

Having individual setters has a couple of advantages: A dedicated setter allows you to put dedicated validations for these properties. You could obviously put them in the bulk setter as well, but tha …
Gordon's user avatar
  • 271
5 votes
Accepted

Divide big class in subclasses

With Composition/Aggregation. first define your interface for Foo collecting all the public methods it should expose from the components: interface Foo { public function methodA(); public func …
Gordon's user avatar
  • 271
2 votes
Accepted

Determining what functions should be implemented in this user-authentication class

Now, this makes me wonder if the rest of my User class design is okay or not. That depends entirely on your viewpoint. You certainly don't have to have a UserEntity, UserRepository, UserFactory …
Gordon's user avatar
  • 271
1 vote
Accepted

Mapping/parsing database table data to output data

The only thing I would change is the mapping definition, e.g. separate the configuration from the actual logic so you don't have to write many mappers, but can use one with multiple configurations. Q …
Gordon's user avatar
  • 271
1 vote
Accepted

A form builder component

You could expand on the Builder component so that it encapsulates creation of the possible form components. This way, I do not have to new the various subparts, e.g. the FormElements. This then reduce …
Gordon's user avatar
  • 271