Note that there are some explanatory texts on larger screens.

plurals
  1. POVBA for Office Class Module (Object) Factory
    primarykey
    data
    text
    <p>I have a relatively complex application for Access 2007 written in VBA (4 enumerations, 7 modules, 38 class-modules, 86 forms, and a whole slew of tables and queries) . I've found a situation where it would be beneficial to use an Object Factory design, but so far I am unable to find a clean way to implement this type of functionality without the standard abstract/inheritance that is easily accomplished in VB or C#.</p> <p>Has anyone had any experience implementing a factory design in VBA, and is it even possible? ... Or is there a neat "trick" that can help me obtain the same overall goal?</p> <p>My experience on factory design is limited to C#, and i've never done it in VB, so maybe there is something in VBA that is common to VB that I am missing.</p> <p><strong>Example</strong></p> <p>I will be receiving a specific date. based on that date i will need to calculate anywhere between 2 and 5 other dates. the rules for calculating these dates changes based on the "type" of date being entered.</p> <p>So if I have a date of 07/15/2009, and this is a type 1 date it would return</p> <p>07/15/2010 for date 1, 07/15/2011 for date 2, 07/15/2012 for date 3, 06/10/2012 for date 4 and 07/10/2012 for date 5</p> <p>if i put the same date but put it in as a date type 2 i would get null for date 1, null for date 2, null for date 3, 06/10/2011 for date 4 and 07/10/2011 for date 5</p> <p>so for each set of rules there will be a minimum of 3 possible max of 6 (for now this could always expand at any time) i will basically be entering a starting date... the rule... and returning an object that will contain all of the date properties.</p> <p>I hope that helps a little bit.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload