Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 5th, 2009, 04:50 PM
Sneakz Sneakz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 90 Sneakz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 2 sec
Reputation Power: 1
VBA - Modules - efficiency and standard programming practices

When using modules to house libraries of user defined functions and code, are there any disadvantages to placing everything in 1 module within your database? Is there any performance increase to using multiple modules to break out Functions?

I'd love to here thoughts on wether or not to just use one huge module or break out code into multiple modules.

What is the standard programming practice when it comes to modules in your database?

Reply With Quote
  #2  
Old November 5th, 2009, 07:28 PM
June7 June7 is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2009
Location: The Great Land
Posts: 536 June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level)June7 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 13 h 58 m 7 sec
Reputation Power: 124
Don't know if there is any standard or convention for module setup but I like to create modules and group procedures based on some commonality. For instance, I have a module 'Utilities' that has some housekeeping code in it, another module 'Data Calc Functions', and a very specialized module 'Soil Classifications', then there is 'Misc' for a multitude of procedures related to the core operations of the project.

Reply With Quote
  #3  
Old November 5th, 2009, 07:49 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,886 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 1 Day 1 h 18 m 41 sec
Reputation Power: 562
There's really no performance effect, it's a matter of ease of code maintenance. I have yet to see the application that doesn't require some changes, at some point. It is messy to deal with huge modules that have dozens and dozens of procedures/functions, to find the one that you need to change or print out for documentation. So it is often very helpful to group them together, as June7 described. Like most everything, it can be overdone, but having a few modules that are sensibly named and contain related procedures/functions. Any grouping that helps you quickly find the code for a particular operation is fine.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
  #4  
Old November 6th, 2009, 11:52 AM
Sneakz Sneakz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 90 Sneakz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 2 sec
Reputation Power: 1
Thanks for the responses guys! I was planning on breaking out modules into "groups" of related code in my next database but had seen other people shove all the code under the sun in 1 module in theirs. I just wanted to be sure I wasn't going to miss out on performance by utilizing multiple modules.

Reply With Quote
  #5  
Old November 7th, 2009, 06:31 PM
ChrisO ChrisO is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Location: Brisbane, Australia
Posts: 5 ChrisO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 59 m 9 sec
Reputation Power: 0
You may also like to think along the lines of reusability.

If we wish to reuse code do we keep that code in one module and import it or do we run around copy/pasting bits and pieces from all over the place?

A simple example would be a global error handling module which is self-contained.
If we wish to use it, just import it.
Comments on this post
don94403 agrees: Good point.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > VBA - Modules - efficiency and standard programming practices


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek