Well, I took me some time formulate this question, so I hope I will be clear enough...
What I try to do is to create a simple validation class, called FieldCheck.
This code gets executed by some other piece of code (well, this is not really the code, but for simplicty, I created a 'working' example):
Okay, this works, and no problem here. But now my real question: will FieldCheck be garbage collected??
I hope not, because the (obvious) purpose of this construction was to create (compile) the
Patterns only once.
But what will happen if the FieldCheck gets garbage collected, if ever. Those are actually my 2 questions:
1) Will it be garbage collected
2) What will happen if it gets garbage collected? (I mean, will the 'static' be called upon a new checkFirstName()?)
If I run into problem with this, is there maybe a different solution to my problem??
Thanks in advance for any replies. If I haven't made my post clear enough, please let me know so I can clear any unclear parts in the post.
Erik