The Project Clones manager showing a tree of clones of a single project
The Project Clones feature isn't a replacement for a version control system like git or mercurial nor for a backup system. The Project Clones feature also doesn't have a merge facility to merge changes from clone A into clone B. Instead you can import changes from clone A into clone B if you want to, using the Import system. To be able to import, you have to understand how clones are stored on disk. This is explained later in this section.
The LLBLGen Pro Designer offers a managed way to create clones of the active project to create a new working copy of the active project to e.g. try things out without worrying where to roll back to when something doesn't turn out to be ok. Project clones remember their parent and are managed in a tree, where a clone of project X is shown as a child of X.
In the example screenshot above, the original project was cloned two times, first in the clone with the name 'Modeling tryout for use case 3' and then later again to 'Tryout for new use case 15'. The clone 'Modeling tryout for use case 3' was then cloned again two times, first in 'Approach 1' and after that to 'Approach 2'. The current active clone is the 'Approach 1' clone. This is also the clone that's present in the .llblgenproj file you'll open in the LLBLGen Pro designer.
Clones are a full copy of the clone, or in the case of the start situation: the original project, and its files, so also the type imports, layout information and sync source overrides are cloned with the clone and thus can change across clones. The original project is always the clone with id 1.
The main use case for project clones is to make it easy to try things out in the designer. For this example we have a project with a couple of entities already created, called MyProject, and it's stored in the file MyProject.llblgenproj. You need to add a group of entities and you want to try if modeling these in a certain way pays off and results in the model you want.
When you start this activity, you create a new clone of the original project, and call it e.g. "Modeling tryout" and make it active. This active clone is now the MyProject.llblgenproj file of your project and loaded into the designer. You start modeling your idea, and halfway you realize you have to choose between two approaches. At this moment, you create a new clone of the clone "Modeling tryout", and call it "Approach 1" and make it active.
You model the rest of the entities, but you're not convinced this is the right approach. So you want to try the other choice you had. You decide to go back to the model you had when you created "Approach 1". To do that, clone "Modeling tryout" again and call it "Approach 2" and make it active. You now model the rest of the entities in a different way as you did in Approach 1, and this time you're satisfied with the result.
As you are done with your work, you can now delete all other project files but keep the active clone, which is "Approach 2". The MyProject.llblgenproj file, which, as "Approach 2" was the active clone, already contains the model you wanted, is kept and all clones you made along the way are deleted.
To create a project clone, go to the Project menu and select Manage project clones.... This opens the Project Clone Manager, which is shown in the screenshot above. The Project Clone Manager is also used to manage existing clones for a given project. Initially when there are no clones, the Project Clone Manager shows the currently loaded project, which is the original project. To clone this project, or any other clone, select it, and click the Clone.. button, and choose whether you want to clone it but not make it active or clone it and also make it active.
The active clone is the clone which is currently stored in the project's .llblgenproj file. All other clones are stored in a folder, which is discussed later in this section.
Clicking the Clone button will open a simple dialog which allows you to specify the name and the description for the clone. The name can contain spaces and can be changed at any time later on. After you've created the clone, the system will make sure the clone is saved to disk and if you also decided to make the new clone active, it's loaded in the designer. The Project Clone Manager offers ways to delete the clones you made, make a clone active and create clones of clones.
Every clone has an ID. This isn't the 'version' of the original project, but just an ever increasing unique id to distinguish clones from one another.
The clone system takes care of saving a project first before it gets clones. So if you currently have a project loaded and have made some changes but not saved the project to disk, and clone it, the designer will first save the project before it clones it to a new clone.
A project clone is a copy of the llblgenproj file of your project into a special folder. In the use case example above, the project file "MyProject.llblgenproj" was cloned. When the first clone is created a new folder is created in the folder the project file is stored, called "projectfilename.clones". In the example case this is MyProject.clones.
This folder contains a file, called "projectfilename.clones", in the example case, "MyProject.clones". This is the file which contains which clone is stored in which file, which clone has which parent and which clone is active.
Each clone is stored in its own file, together with the support files for that clone: layout information, type imports and sync overrides. The format of the filenames is projectfilename.pcid.llblgenproj. So in the situation of our example, after the original project file was cloned, we have MyProject.pc1.llblgenproj, which is the original project file, and the clone, MyProject.pc2.llblgenproj.
If we, say, like some of the elements we created in this clone but not all, we can import them in the original project, using the following steps: (using the example project from earlier, MyProject.llblgenproj)
- Load the
MyProject.llblgenprojfile in the designer
- Open the Project Clones Manager from the Project menu
- Select the original project node and make it the active clone, if it's not the active clone already
- Close the Project Clones Manager and open the Import system dialog. Browse to the
<MyProject root folder>\MyProject.clonesfolder and open the
MyProject.pc2.llblgenprojfile as import source.
- Select the elements you want to import.
You can now delete the clone.
It's not recommended to manually remove the files in the .clones folder.