Link to home
Start Free TrialLog in
Avatar of developingprogrammer
developingprogrammer

asked on

what's the use of PublicNotCreatable?

hey guys, i wanted to create a resource library / resource repository for my code in Access and i was thinking of using PublicNotCreatable. however after playing around with it for awhile and reading some articles on it i realised that it's meant for a different reason - not to emulate a static class or abstract class.

from my understanding it's used by a function in its containing project to be created and passed to its caller. completely doesn't make sense to me at all. below is the reference article i read.

http://support.microsoft.com/kb/555159

question time!

1) how come the PublicNotCreatable class can be created by a function in its containing project? shouldn't it then be ProtectedCreatable?
2) what's the use of this enforced additional function layer to create this object?
3) how do i create a static class in vba?
4) and can PublicNotCreatable behave as a static class or is the only way to create a static class to use a singleton pattern to implement this? ok i know it's still an instance but at least it's a single instance right? = )
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

A number of versions ago, there was a Code Library add-in for Access that could be used for this purpose, but it was dropped the next version.  I keep code segments in plain text files in a folder.  Crude, but it works, and it won't go obsolete.
Avatar of developingprogrammer
developingprogrammer

ASKER

i see - so how do you refer to the code in your text file then? thanks Helen!
ASKER CERTIFIED SOLUTION
Avatar of Bitsqueezer
Bitsqueezer
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
whao Christian, this is definitely a lot to digest cause we're talking more about a meta level now which i am not too familiar with, but i get your drift and just need to understand the implementation of it. but what you're saying is extremely powerful and reuseable. let me spend a bit more time on this and reply you with intelligent pointed answers = ) thanks Christian and you're amazing!! = ))
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
guys i need a bit more time to digest this. i'll get back to yall! = )
guy need more time as still not at the finishing stages of the project yet sorry!
hey Christian and aikimark,

thanks so much for your help and once again i'm so sorry for the delayed response.

Christian i think you've very clearly answered my question here in terms of why it is PublicNotCreatable - probably cause it runs in its own context = ) so i'm closing this question as per what the admins have advised me to do.

however i've got more questions which i will ask at a later date - saving this in my personal knowledgebase.

basically i think it's a bit fuzzy in my head now as to what constitutes the domain of creating reuseable components which we can pass around.

the things in my head now are as per below - we've got a few terms, how do they relate to each other and how do they form the realm and choices of how we implement reuseable components.

will ask at a later date but here they are below. thanks Christian and aikimark once again for being so patient with me!! = )

activex object
import the latest copies of the (text) files into your VBProject object.
dlls
components
add ins
external code libraries