Click here to Skip to main content
14,301,066 members

C / C++ / MFC

 
GeneralRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 8:47
memberk505420-Jan-19 8:47 
GeneralRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 8:52
memberk505420-Jan-19 8:52 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_21-Jan-19 6:56
memberVaclav_21-Jan-19 6:56 
GeneralRe: Complex multidimensional array in C++ Pin
Richard MacCutchan21-Jan-19 22:36
protectorRichard MacCutchan21-Jan-19 22:36 
AnswerRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 4:54
memberk505420-Jan-19 4:54 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_20-Jan-19 10:13
memberVaclav_20-Jan-19 10:13 
AnswerRe: Complex multidimensional array in C++ Pin
Stefan_Lang20-Jan-19 21:29
memberStefan_Lang20-Jan-19 21:29 
Questionis there any relation object states control and encapsulation? Pin
nig3D19-Jan-19 8:05
membernig3D19-Jan-19 8:05 
I am writing an article on best practices and in this article I am trying to formulate an hypothesis for which public functions eventually lead to most of the code design issues. It's not public functions per se, but more about inter-objects communication (messaging).
Established that encapsulation works fine for data abstract types, how would you define the situation in which stateful objects with well defined behaviours, do not have control on their states? Let's say in the best case scenarios, I have a well defined object with well defined behaviours, like Walk() and Run() but doesn't have control on when it walks and when it runs. Other objects will control when this object walks or runs. Let's now say that this object is used in a spaghetti codebase, where the reference to this object is injected indiscriminately. The object could potentially find itself walking or running at the wrong times. What I am trying to say is that encapsulation ensures the validity of the states, but cannot determine if the states are set at the right time.
How would you define this problem? I know how to solve it, I am just trying to understand if encapsulation is involved at all in this problem. Without public functions this problem wouldn't exist in the first place, but is the possibility of settings states at the wrong time a form of broken encapsulation?

modified 19-Jan-19 14:34pm.

AnswerRe: is there any relation object states control and encapsulation? Pin
phil.o19-Jan-19 9:41
mvephil.o19-Jan-19 9:41 
AnswerRe: is there any relation object states control and encapsulation? Pin
CPallini19-Jan-19 10:34
mveCPallini19-Jan-19 10:34 
JokeRe: is there any relation object states control and encapsulation? Pin
Peter_in_278019-Jan-19 10:51
professionalPeter_in_278019-Jan-19 10:51 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D20-Jan-19 4:23
membernig3D20-Jan-19 4:23 
GeneralRe: is there any relation object states control and encapsulation? Pin
Peter_in_278020-Jan-19 10:49
professionalPeter_in_278020-Jan-19 10:49 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D27-Jan-19 10:25
membernig3D27-Jan-19 10:25 
AnswerRe: is there any relation object states control and encapsulation? Pin
leon de boer19-Jan-19 18:47
memberleon de boer19-Jan-19 18:47 
QuestionWhat are the programmers' opinions about Plain English Programming? Pin
Quantum Robin18-Jan-19 8:04
memberQuantum Robin18-Jan-19 8:04 
QuestionRe: What are the programmers' opinions about Plain English Programming? Pin
David Crow18-Jan-19 16:21
memberDavid Crow18-Jan-19 16:21 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
leon de boer19-Jan-19 2:48
memberleon de boer19-Jan-19 2:48 
GeneralRe: What are the programmers' opinions about Plain English Programming? Pin
Stefan_Lang20-Jan-19 22:08
memberStefan_Lang20-Jan-19 22:08 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
Alan Balkany22-Jan-19 5:45
memberAlan Balkany22-Jan-19 5:45 
QuestionHow to recognize a MutliTouch Input Event ? Pin
Member 1406801918-Jan-19 3:11
memberMember 1406801918-Jan-19 3:11 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
Victor Nijegorodov18-Jan-19 5:14
memberVictor Nijegorodov18-Jan-19 5:14 
AnswerRe: How to recognize a MutliTouch Input Event ? Pin
k505418-Jan-19 5:18
memberk505418-Jan-19 5:18 
QuestionToolbar for bottom split window - CSplitterWnd Pin
Anu_Bala15-Jan-19 23:31
memberAnu_Bala15-Jan-19 23:31 
AnswerRe: Toolbar for bottom split window - CSplitterWnd Pin
Victor Nijegorodov15-Jan-19 23:44
memberVictor Nijegorodov15-Jan-19 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.