AC Blog-ish
#11
For that specific case, voteinfo would be either a struct or a class and it will function in the same way with no error nor it would crash because it is a passive data structure. If voteinfo actually were a derived class or implemented virtual methods probably there would be a problem when trying to deserialize it since the actual vtable would override the previous one.
Try changing the struct by class keyword and you'll see for yourself?
Now in the strict sense of OOP if it were a class instead of a struct it would be a badly designed class because it's breaking a corner stone in OOP: Encapsulation, since member data is public, and it should be private and it should provide accessors and mutators as a means to change its state.
Thanks given by:


Messages In This Thread
AC Blog-ish - by Mousikos - 29 May 15, 12:14AM
RE: AC Blog-ish - by Mousikos - 29 May 15, 06:06AM
RE: AC Blog-ish - by Mousikos - 29 May 15, 08:07AM
RE: AC Blog-ish - by Mr.Floppy - 29 May 15, 09:51AM
RE: AC Blog-ish - by Mousikos - 29 May 15, 11:16AM
RE: AC Blog-ish - by Mr.Floppy - 29 May 15, 11:55AM
RE: AC Blog-ish - by Mousikos - 29 May 15, 06:30PM
RE: AC Blog-ish - by MathiasB - 29 May 15, 06:51PM
RE: AC Blog-ish - by Luc@s - 29 May 15, 06:34PM
RE: AC Blog-ish - by Mousikos - 29 May 15, 06:40PM
RE: AC Blog-ish - by TheNihilanth - 29 May 15, 06:58PM
RE: AC Blog-ish - by Mousikos - 29 May 15, 10:47PM
RE: AC Blog-ish - by MathiasB - 01 Jun 15, 09:28AM
RE: AC Blog-ish - by Mr.Floppy - 01 Jun 15, 11:58AM
RE: AC Blog-ish - by Ronald_Reagan - 29 May 15, 11:20PM
RE: AC Blog-ish - by Mousikos - 29 May 15, 11:27PM
RE: AC Blog-ish - by Mousikos - 31 May 15, 08:26PM
RE: AC Blog-ish - by 1Cap - 01 Jun 15, 01:29PM
RE: AC Blog-ish - by Mousikos - 04 Jun 15, 06:07AM
RE: AC Blog-ish - by MathiasB - 04 Jun 15, 07:37AM
RE: AC Blog-ish - by Thrawn - 04 Jun 15, 11:35PM