• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 843
  • Last Modified:

TFS Organization Opinions

Hello,

I wanted to see other people's opinion of how to organize your source code in TFS.

So, a simple breakdown.  We have the organize the following code:

1. ASP.NET project
2. SQL Server Database Project
3. SQL files: Stored procedures, scripts, functions
4. SQL Server Reporting Services reports

Do you organize your sql files with your database project in TFS?

Do you organize your sql files with your reports project in TFS?

Or do you organize you sql files with your ASP.NET C# project (considering those sql files are only called from that ASP.NET C# project)?

Thanks for any opinions...
0
michael1174
Asked:
michael1174
2 Solutions
 
Bob LearnedCommented:
We use the following structure in TFS:

Common
      Source Code
           OracleDataAccess
           DocumentGeneration
      Binaries
           iTextSharp
           log4net

Solution #1
     Development
         Sandbox
     Main
         Shared Source
             DocumentGeneration
         Shared Binaries
             log4net
         Source
     Release
          Production
             v1.0.10.0
     
Solution #2
     Development
         NewMenu
     Main
         Shared Source
             OracleDataAccess
         Shared Binaries
             iTextSharp
         Source
     Release
          Production
              v2.9.0.0
     
All shared projects are under the Common, and then branched out to each Solution, under the Main\Shared Source folder.  

When a solution is deployed, branch to the Release folder, under the matching environment (UAT, Production, etc.).  Always keep the Main trunk functional.  If you need to experiment, branch to Development.  

Since assembly references are relative to the solution path, having references point to Shared Binaries, rather than the Common folder, makes it easier to branch.  Also, you create a separation between the source and the target.  This means that you need to spend more time managing merging and branching, but it's worth it in my opinion.
0
 
Mohamed OsamaSenior IT ConsultantCommented:
Let's see

- Do you organize your sql files with your database project in TFS?
YES, DB Projects contain all DB related content , scripts,models, artifacts,documentation,etc..


- Do you organize your sql files with your reports project in TFS?

Not currently  , but it can be done if needed

what the learned one described above is an environment very similar to ours

 Main Code branch that branches to DEV, UAT or QA , and Production which is the final release source that gets tested and Approved by QA testers.

we do have a common Folder for 3rd party libraries and shared code also.

your main question's answer  is relative, where you store the SQL files depends on the nature of your Projects, and is pretty much your own decision.

in some organizations the .SQL scripts have their own section in the repository , and in others, SQL files are stored alongside other projects depending on Certain releases , builds, labels, or tasks for example.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
michael1174Author Commented:
In storing sql files in with the db vs. a visual studio project, what happens if you want to rebuild the db from all your source control files? You would need to hunt for all  those files scattered in all different projects to build the db accurately.

If you keep the sql files with the db project, you wont have that problem.

I guess I'm looking for pro's & con's, but as you mention, it may be preference.

Another example would be, what happens if you need rename a column in your database or change its datatype.  If you stored your sql scripts with projects you would need to then search for all scripts/sp's that use that field in the projects, whereas if you keep the sql files with the db, they are all in 1 easy to find project.

I'm looking for other scenario's, like these if possible.

Thanks...
0
 
Bob LearnedCommented:
When I was using SQL Server Database Projects, those would go in a top-level folder, since they really don't need to be in a project-specific folder, buried somewhere deep in the hierarchy (as you described).  You are right, that there are a lot of script files generated for a database, and being able to find those easily is usually paramount in our jobs.

Do you generate test data, and use database unit tests?  Those usually need to go with the project, but that would be personal preference.
0
 
michael1174Author Commented:
Thanks for the opinions...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now