CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

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



Comments

Steve said:

+1 for putting them in the same namespace/project as the classes they create.
# November 3, 2003 4:45 AM

Brendan Tompkins said:

I agree, but what if you cannot because of circular reference problems? Most of my factory created classes are in my Common tier.
# November 3, 2003 5:08 AM

Addy Santo said:

Same Namespace ++
# November 4, 2003 9:13 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors

Proudly Partnered With


This Blog

Syndication

News

MVP
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.