Organizing hundreds of personal and example projects? - archive

How do you organize projects when you have hundreds of them? Not layout within a project, but layout of the project root directories.
I'm consolidating a decade+ of personal and example projects that are scattered all over the disks on several systems, and am looking for some organizational method that will let me keep the dozen or so active projects visible, and the archived projects findable.
Most of the projects are learning experiments, cutting across bunch of different language and frameworks. Some of the projects are full-fledged, working applications that I reach into to reuse ideas and code.
I'm using a flat namespace in a remote git repository for my personal stuff, but that seems like a less than ideal way of organizing things on my development systems. There must be something better than ~/active/ and ~/archive/.
What works for you in this situation?

Leave it as it is. You organization or absence of such is a history. Keep it.
Maybe create a few directories to organize stuff in chronological order, years and maybe months of you were that creative.

These are all personal preferences but maybe one of these will help you
I always keep a "temp" or "POC (proof of concept)" folder for examples and things I'm just trying out
I always use an Archive folder for those projects that I know I will not need
I try to keep projects grouped by technology (other than my main technology) so I'd have a Silverlight folder, Flex folder, C++, etc..
I always have a Tutorials folders for things I've downloaded from the internet or other users.

I break my personal projects down into the following categories and sub categories. The hierarchy of categories is then translated into a file system structure.
Long Term Projects
Projects which I plan to either have multiple versions of or multiple branches going at the same time. Essentially anything that I will be using for more than 6 months or so
CLR Based CodeI used to further break this down by language. But I have so many mixed language projects now that I don't do this anymore. It just makes it more confusing./li>
Java
C++
Everything Else

Related

SSDT Circular reference: Complex project

I have a fairly complex setup with eight databases on a server each referencing each other (about every database referencing each other), giving way to quite a complex web. The design is far from ideal, but unfortunately this is something we have to work with.
We need to create a SSDT solution to facilitate CI/CD
The whole project needs to be deployed from scratch on a new instance and I am trying to get my head around this, as I have limited SSDT knowledge for a project this scale.
The approaches I consider are as follows:
1) Split objects into shared objects, and reference the shared objects. This seems to be a nightmare to implement, as we would require different layers because of the complex web of references. (shared object referencing other shared objects). Also how do we deploy such a project on a blank server?
2) Create stubs for each object in a project being referenced by other objects, and make a database reference to these. This seems to be the easiest option, although it seems that if the object the stub is based on gets changed, the stubs also needs to be maintained otherwise the project will break. Is this the right assumption?
3) Only create stubs for projects required to compile (eg. tables referenced by views in other databases), and ignore warning references. I am leaning towards this route as the stubs will be much smaller and project easier to maintain, but I hate to ignore referencewarnings..
If we deploy using the stubs option, do we need to deploy the stubs first and then delete them after successful deployment?
Another (more straightforward question). What is the best way to deploy logins, users and object permissions ?
Thanks for replying.
The question is too broad but these are few suggestions:
You can't do anything with circular reference. There are some ways to workaround it but all of them are "hacky" and most probably will introduce more problems than to solve your problem. So try to move objects in so manner that there is only one way dependency;
Use synonyms for ALL cross database objects, so there supposed to be no straight reference outside database;
I agree with Peter Schott that it is better to ignore logins and users for now as handling them in SSDT is a bit of pain and you need to have good expertise on SSDT to make it working properly.

Is there an easier way to merge Windows Forms .Designer files?

We just recently switched from TFS to Mercurial for our small team. The main project that 3 people work on is a Windows Forms application in C#. Every time you use the designer, even for simple changes, it does a whole lot of rearranging and changing to the .Designer file. If two people work on this file, even making simple changes, the merge is an absolute nightmare. Is there an easy way to solve this problem? In TFS, we turned off concurrent edits so we did not have this problem.
The problem is every time the code gen engine may generate code in different order!!! which makes merging a pain.
WinForm (.NET) designer, Swing (Java) designer rely on the code gen engine.
ASP.NET's designer.cs only contains backing field, which less likely to suffer.
WPF's backing field is generated in obj/*.g.cs, which is not required to keep in source control, so no merging problem.
Merges of these kind of files are always painfull... This is the reason why some "locking" extensions for Mercurial exists, so you can have the same workflow as with TFS if needed.
For example you can use the Lock extension written by Martin Geisler to lock .Designer files until the next push, doing so you will avoid any concurrent modification thus avoiding the merge also.
This is what I do:
Copy/Use .Desinger.cs from master/develop branch and open project in VS
Copy whole project (all files with .git) and checkout your_feature branch and open project in VS
now at this point you should have 2 instances of VS (one on master branch and one on your_feature)
Copy controls (ctrl+c) (in design view/mode) from one VS to another
not perferct solution but helps a lot

Organizing Apex Classes under Namespace

Is there any way in Salesforce to group apex classes under a package or namespace? Can we use managed package for internal organization purpose?
This is a limitation in the force.com stack that makes medium-large size projects painful, if not impractical. Using managed packages in order to get a package prefix doesn't really solve any problems, so it's not really worth the trouble.
I usually try to organize a project into one flat level of namespaces. In lieu of actual namespaces, I'll give each would-be-namespace a 3-5 character name, to be used as a prefix. Any class that belongs in the "namespace" gets prefixed. E.g., if I need a payroll namespace, I'd use a PYRL prefix. A class called PaycheckCalculator becomes PYRL_PaycheckCalculator.
The practical advantage of this type of convention is it helps prevent name clashes and classes are grouped by their "namespace" when viewed in a sorted list, such as in an IDE, or Setup > Develop > Apex Classes
Unfortunately, several basic OO principles are still fundamentally broken. Probably the most important one is every class forms an implicit dependency on every other class it has visibility to, which is all of them.
I'd love to hear how others have worked around this limitation.
Well, you can use managed packages, but as Jeremy mentioned it doesn't really buy you much. Of course managed packages are essential for developing publicly listed apps to sell on the AppExchange. But internally it's really an org-wide problem since once you create a managed package with a prefix, everything that touches any other part of it gets stamped with the same namespace prefix, including all custom objects. And worse, you can't access code in a managed package from outside the managed package (which is actually the whole point of them in the first place).
Although it's not the prettiest solution, what I personally do is maintain numerous named orgs with different purposes, applications and utility classes. When I need a utility class in one org, say I'm building a new app destined for the AppExchange, I'll do an Eclipse Export/Import from the utility org in question. It definitely seems strange but having a library of orgs is the best way I've managed to keep track of everything and to manage "internal" organization. But the end result is really just a glorified copy-paste operation between arbitrary code stores.
I faced similar challenges while working on big projects, wrote this blog post sometime back to share the approach I am following now : http://www.tgerm.com/2011/11/apex-class-naming-convention-suggestion.html

Team Foundation Server 2008: How to move files from one Project to another.

I am using Team Foundation Server (TFS) 2008, and am preparing to merge several TFS projects together, and I'd like to do this in the best way possible. All of these projects are within a single TFS instance.
I merging projects because the product line that is contained in all of the projects is small and is worked on by a single, small team, and so the projects themselves are simply unnecessary. Thus, I am trying to simplify our structure by merging the projects together. What this amounts to, I think, is a need to move the files from all projects into just one of the projects. But, I want to do this without affecting file history, etc.
I have tried researching this, and have found the following resources:
Moving files from one Team Foundation Project to Another
Moving files between projects in Solution Explorer removes source
control history, breaking merge capabilities
The second resource, a Microsoft knowledge base article, actually looks pretty useful. But, before I dive into this, I am just wondering what advice and/or warnings the SO community might offer? I am just hoping to go into this with my "eyes wide open."
Moves within Solution Explorer (and Solution Navigator from Productivity Power Tools) a move of a solution item will lead to a delete and add in version control.
But you can also move items either within Source Control Explorer or using tf.exe's move command from the command line. The latter can, of course, be automated with in a script if there are many items to move.

WPF Architecture & Creating Unique Builds

I haven't figured out the correct programming architecture for:
-WPF Application
-Each build will be unique for each customer
-There will be unique variables for each customer in both code and the app.config file
-Ideally, there will also be unique deployment URLs for each customer
What is the best way to build the project file given this scenario? Im using VS 2008 Pro. I can create all of the above and use ClickOnce for deployment, but its the unique variables for each customer that I need help with.
It's not 100% exactly what I need, but it's close. This article has an explanation of how to work with multiple config files and assign one during the pre-build process. It still doesn't allow me to set pieces of code like I would like, but it's almost close enough: http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx

Resources