Brendan Tompkins [MVP]

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Factory Class Best Practices?

Does anyone have any suggestions about where to locate factory classes?  I've got a bunch of static factory classes that I use to create other classes.  I've put a lot of these into my common tier, in our Common.Util namespace.   I just ran across a class that I can't put into my common tier, since it references a business tier object.  So I've put it into my Business.UserAuthentication.Util namespace.  But, now I'm thinking that a VIT.Business.Factories namespace may be best.  Or should I locate these in a  Util namespace for each assembly?

Music tip: Check out The Thrills


Posted 11-03-2003 8:35 AM by Brendan Tompkins
Filed under:

[Advertisement]

Comments

Jesse Ezell wrote re: Factory Class Best Practices?
on 11-03-2003 4:12 AM
Factory classes should generally go in the same namespace/project as the classes they construct.
Steve wrote re: Factory Class Best Practices?
on 11-03-2003 4:45 AM
+1 for putting them in the same namespace/project as the classes they create.
Brendan Tompkins wrote re: Factory Class Best Practices?
on 11-03-2003 5:08 AM
I agree, but what if you cannot because of circular reference problems? Most of my factory created classes are in my Common tier.
Addy Santo wrote re: Factory Class Best Practices?
on 11-04-2003 9:13 AM
Same Namespace ++

Add a Comment

(required)  
(optional)
(required)  
Remember Me?