StrataFrame Forum

Wheres the best place to put common methods

http://forum.strataframe.net/Topic25419.aspx

By Ger Cannoll - 12/16/2009

I am uisng c# as main language

I am starting to build up a lot of common methods that will be used across Buisness Objects. e.g. Validating Lookups, Picking out descriptions etc. that will typically need to go out to Database Tables (rather than access internal Buisness Objects)

I have to decide where to put this code....do I just put then all into a common .CS file, Do I create a .DLL separate project... wondering what is the best pracrise here.

Tia.

By Les Pinter - 12/17/2009

Hi Gerard,

   I'd say that if the methods are all going to be used in a single project, a .cs file in the project would be adequate. That's especially true if you're continually adding more code to the class. I'd only create a separate project and dll if i just wanted to include the dll in all of my projects without the source code.

Les

By Greg McGuffey - 12/17/2009

I'm using the suggested SF architecture of having a Base assembly were I put this kind of stuff. Likely if I had a single assembly project, I'd put this kind of common code in its own folder, with its own namespace. I definitely tend toward using the base assembly approach though, as it makes it easier to share with other projects/solutions.
By Ger Cannoll - 12/18/2009

Thanks  for your replies lads. I think initially I might put Misc stuff into a 'Common' CS file and maybe look at it again down the road.