Tag Info

Hot answers tagged

7

Builders are most useful when your object needs a lot of arguments/dependencies to be useful, or you want to allow many different ways of constructing the object. Off the top of my head, I can imagine someone might want to "build" objects in a 3D game like this: // Just ignore the fact that this hypothetical god class is coupled to everything ever new ...


5

What you are saying is absolutely normal. As the British would say, "if you don't use it, you lose it" This however is not necessarily absolutely true. As Killan Foth pointed out in the comment above, your memory is much more complex than that. It keeps it in store somewhere, just harder(slower) to find (computer memory btw tries to mimic this, hence L1 ...


1

I agree with what has been said but if you really want a memorisation system then investigate the Leitner cardbox system . You could write a program to implement this or google for flashcard systems etc. Another good way to recall technical details is to maintain a blog. The act of reflecting on what you have learned and then writing about it will reinforce ...


1

You need to use a memento. At each step you look at the previous state and store it in a temporary object. If at any time there is a failure that requires rolling back, you simply look at each memento and restore the original state. This should normally be done as a LIFO stack to ensure changes are undone in reverse order. Note the term "roll back" here: ...


1

Visitor classes should strictly follow SRP (Single Responsibility Principle) so using visit as common naming convention would be the most appropriate. As far as entity classes are concerned, they will usually do more than allow visitor classes to visit them, so name accept can introduce naming conflict if entity class would have accept method that serves ...


1

StartDate and EndDate of what?.... the school year? Ok: public class SchoolYear { StartDate = DateTime.Now; EndDate = new DateTime (2016, 6, 23); } Object Oriented Programming is about, well, objects: Put properties in a class to appropriately describe/define what it is. Write methods against those properties to describe/define what it does. As ...


1

I believe neither of your approaches violate anything and both can be used just fine. Passing parameters to the builder can be done either using constructor or setter methods. I do not see any problem with it. I tend to pass parameters via constructor if there are not so many of them. If I have more than 3-5 configuration parameters I switch to using ...


1

NO. And I'm surprised how many people voted otherwise! Paradigm It's Data-Oriented a.k.a. Data-Driven because we are talking about the architecture and not the language it's written in. Architectures are realizations of programming styles or paradigms, which can usually be unadvisably worked around in a given language. Functional? Your comparison to ...



Only top voted, non community-wiki answers of a minimum length are eligible