Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OOP, encapsulation and bulk loading

Name: Anonymous 2010-07-04 19:10

So I have this class that represents a thing that can be created or loaded and saved, it's nice and encapsulated - it has a couple of properties that are private with public getters and setters. Nothing special, when I load this thing - properties get set directly, when I create it - I use property setters that do some sanitization and validation.

Now the question. I also, for performance reasons, need to bulk load these things.
1st, where could I put such method? It doesn't really belong on the things class, I mean static <Thing[]>Thing.Load(keys[]) doesn't look right at all.
2nd, how would I initialize these things? I don't want to use the public setters, because, as I mentioned, they do some checking that's necessary only the first time, when I'm loading it from the storage, everything is already sane. I also don't want to expose the properties publicly. Currently I have a constructor that takes all properties and sets them directly, but that's ugly.

Name: Anonymous 2010-07-08 17:30

Name: Anonymous 2010-07-08 17:45

>>40-41
Payment processing error: NSF.

Name: Anonymous 2010-07-08 18:29

>>42
not safe for .  ?

Name: Anonymous 2010-07-08 19:01

>>43
Network Sile Fystem.

Name: Anonymous 2010-07-10 10:35

It's strange that no one suggested this, but obviously what you do to solve the 2nd problem, is to leave the public setters as they are - public, but instead of having private(C#)/protected(C#)/private(Java) properties you make them internal(C#)/protected(Java)! This way when you bulk load the Things you can use properties directly, bypassing setters.

Name: Anonymous 2010-07-10 11:02

>>1
Hackish way: reinterpret_cast.
SCALABLE ENTERPRISE SOLUTION: Move the validation to a separate class.

Name: Anonymous 2010-07-10 11:29

  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_
__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/
  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \_

Name: Anonymous 2010-07-10 14:28

>>47
STILL WAITING FOR THOSE PENROSE TILINGS

Name: Anonymous 2010-07-10 15:47

try{
bool EnterpriseBulkComparator.Boost_utility.Variables.LegacyCVariables.MoreOrLessEqual.is_post_similar_to_thread = std::lexicographical_compare(post(timestamp.compare.getSystemTime()), post_end(sTonight),thread.begin(Encapsulation),thread.end(Of the World));}catch{Pikachu}

Name: Anonymous 2010-07-10 16:17

>>48
STILL WAITING FOR FUCK OFF XARN.

Wait, you're not Xarn.

Name: Anonymous 2010-07-10 16:24

>>50
why u do dis?

Name: Anonymous 2010-07-10 17:26

>>35
There are no Xarn haters on Twitter, and no Xarn fanboys outside of the imagination of the bashers.

Name: Anonymous 2010-07-10 17:49

There are no Xarn haters on Twitter
There no Xarn fanboys outside of the imagination of the bashers.
Therefore no one uses Twitter.

Name: Anonymous 2010-07-10 18:00

>>53
I think your theorem prover is broken.

Name: Anonymous 2010-07-10 18:06

>>52
There are no Xarn haters on Twitter
Proof?

Name: Anonymous 2010-07-10 18:15

>>52
brb, creating the @XarnHater twitter account

Name: Anonymous 2010-07-10 18:21

>>54
>>52's syllogism generator is broken. It has a bug where it gets stuck on the last clause. I was merely providing the elided material.

Name: Anonymous 2010-07-10 18:31

>>57
>>54: ``Your conclusion does not follow from your premises.''
>>57: ``No, I was just drawing a conclusion from the premises.''

Name: Anonymous 2010-07-10 22:29

>>58
I drew no conclusions. I merely provided them. You, however, have drawn the same non-sequitur twice now.

Name: Anonymous 2010-07-10 22:46

>>59
You really should stick to using your name and sig, so I don't have to see your posts.

Name: Anonymous 2010-07-11 0:23

>>60
Hahaha. No, I'm not that cool.

Name: ​​​​​​​​​​ 2010-10-25 0:15

Name: Anonymous 2011-03-11 10:02

Nice thread

Name: Anonymous 2011-03-11 10:30

Nice boat

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List