It's all about the answers!

Ask a question

Breaking existing code to components


Michael Sternberg (8181) | asked Oct 18 '10, 11:31 a.m.
We're considering migration from CMVC to RTC and thinking about breaking the existing code into RTC components. Right now our folders structure looks like following:

root
...src
......product_name
.........incs
.........libs
.........client
.........server

"incs" and "libs" contain a common code that is used in both "client" and "server" components. Is it possible to have client, server and common code divided into three components ? Is it possible to define somehow dependencies between components (e.g. in order to build "client" you have to load "client" and "common" components..) ?

7 answers



permanent link
Geoffrey Clemm (30.1k23035) | answered Oct 19 '10, 1:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The order of building is controlled/defined by your build script.
WRT dividing code into RTC components, a couple of rules of thumb are:
- You don't want to have too many components loaded into a single
workspace, because it makes the GUI slow ... so a few dozen, not a few
hundred.
- You cannot move change sets across components, so it is best to put
two directory trees into the same component if you think you might want
to move files from one of those directory trees to another.

Cheers,
Geoff

On 10/18/2010 11:38 AM, mishka wrote:
We're considering migration from CMVC to RTC and thinking about
breaking the existing code into RTC components. Right now our folders
structure looks like following:

root
src
product_name
incs
libs
client
server

"incs" and "libs" contain a common code that is
used in both "client" and "server" components. Is
it possible to have client, server and common code divided into three
components ? Is it possible to define somehow dependencies between
components (e.g. in order to build "client" you have to
load "client" and "common" components..) ?

permanent link
Michael Sternberg (8181) | answered Oct 19 '10, 6:36 a.m.
Actually I was asking something else.
1. Can I create a component A that will contain all files inside of "src/product/client/", component B that will contain all files inside of "src/product/server" and component C that will contain all files inside of "src/product/incs" and "/src/product/libs" ? I got the impression that it's impossible in RTC, different components can not contain same set of folders.

2. How developer, that wants to build Client on his local computer, should know that additionally to "A", that contains the client sources, he also supposed to load "C", which contain common sources, that are needed for client build ? Is it possible to set up some kind of dependency between RTC components ?

The order of building is controlled/defined by your build script.
WRT dividing code into RTC components, a couple of rules of thumb are:
- You don't want to have too many components loaded into a single
workspace, because it makes the GUI slow ... so a few dozen, not a few
hundred.
- You cannot move change sets across components, so it is best to put
two directory trees into the same component if you think you might want
to move files from one of those directory trees to another.

Cheers,
Geoff

On 10/18/2010 11:38 AM, mishka wrote:
We're considering migration from CMVC to RTC and thinking about
breaking the existing code into RTC components. Right now our folders
structure looks like following:

root
src
product_name
incs
libs
client
server

"incs" and "libs" contain a common code that is
used in both "client" and "server" components. Is
it possible to have client, server and common code divided into three
components ? Is it possible to define somehow dependencies between
components (e.g. in order to build "client" you have to
load "client" and "common" components..) ?

permanent link
Geoffrey Clemm (30.1k23035) | answered Oct 19 '10, 2:23 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
WRT (1), yes, one cannot have two components with the same folders.
What you can do instead is have a "server" and an "incs" component, and
"load" those components in the src/product folder. The problem with
this today is that you cannot store that information with those
components, so every workspace has to do that manually. There is a work
item to allow you to specify this as a "load path" as part of the
metadata that is persisted about the component.

WRT (2), that is handled currently by having different streams that
contain the set of components that need to be loaded together.

Cheers,
Geoff

On 10/19/2010 6:38 AM, mishka wrote:
Actually I was asking something else.
1. Can I create a component A that will contain all files inside of
"src/product/client/", component B that will contain all
files inside of "src/product/server" and component C that
will contain all files inside of "src/product/incs" and
"/src/product/libs" ? I got the impression that it's
impossible in RTC, different components can not contain same set of
folders.

2. How developer, that wants to build Client on his local computer,
should know that additionally to "A", that contains the
client sources, he also supposed to load "C", which contain
common sources, that are needed for client build ? Is it possible to
set up some kind of dependency between RTC components ?

gmclemmwrote:
The order of building is controlled/defined by your build script.
WRT dividing code into RTC components, a couple of rules of thumb
are:
- You don't want to have too many components loaded into a single
workspace, because it makes the GUI slow ... so a few dozen, not a
few
hundred.
- You cannot move change sets across components, so it is best to
put
two directory trees into the same component if you think you might
want
to move files from one of those directory trees to another.

Cheers,
Geoff

On 10/18/2010 11:38 AM, mishka wrote:
We're considering migration from CMVC to RTC and thinking about
breaking the existing code into RTC components. Right now our
folders
structure looks like following:

root
src
product_name
incs
libs
client
server

"incs" and "libs" contain a common code that is
used in both "client" and "server" components.
Is
it possible to have client, server and common code divided into
three
components ? Is it possible to define somehow dependencies between
components (e.g. in order to build "client" you have to
load "client" and "common" components..) ?


permanent link
Michael Sternberg (8181) | answered Dec 05 '10, 9:11 a.m.
WRT (1), yes, one cannot have two components with the same folders.

What you can do instead is have a "server" and an "incs" component, and "load" those components in the src/product folder. The problem with this today is that you cannot store that information with those components, so every workspace has to do that manually. There is a work item to allow you to specify this as a "load path" as part of the metadata that is persisted about the component.

Has the situation improved with release of RTC 3.0 ? How do I specify a "load path" inside of component ? Maybe by some clever usage of .project file ?

Here's explanation of the problem again. I have the following directory structure and have to define four RTC components: "Project", "Client", "Server" and "Incs". I've tried every possible option of loading of components in RTC 3.0 and failed to do what I need.. :(

Project

.jazzignore
.project
Project.sln

client
.jazzignore
.project
Client.cpp
Client.vcproj
ReadMe.txt
stdafx.cpp
stdafx.h
targetver.h

incs
.jazzignore
.project
common_header.h

server
.jazzignore
.project
ReadMe.txt
Server.cpp
Server.vcproj
stdafx.cpp
stdafx.h
targetver.h

permanent link
Nick Edgar (6.5k711) | answered Dec 05 '10, 11:43 a.m.
JAZZ DEVELOPER
When loading a workspace with multiple components, normally it does not create separate folders for the components, though this is now an option in 3.0 during the build (see the 'Create folders for components' option in the Jazz Source Control page of the build definition). Without this option, top-level folders or files with the same names would collide. However, I'm not sure whether this option is supported in the Visual Studio client. I'd recommend that each component have a unique top-level folder name.

So one option would be:

Component 'Project':
Project
.jazzignore
.project
Project.sln

Component 'Client':
client
.jazzignore
.project
Client.cpp
Client.vcproj
ReadMe.txt
stdafx.cpp
stdafx.h
targetver.h

Component 'Includes':
incs
.jazzignore
.project
common_header.h

Component 'Server':
server
| .jazzignore
| .project
| ReadMe.txt
| Server.cpp
| Server.vcproj
| stdafx.cpp
| stdafx.h
| targetver.h


With this approach, though, the 'Project', 'client', 'incs' and 'server' folders would all be siblings. You probably want to have the latter 3 nested under 'Project', but I don't see any way to do this in RTC 3.0.

You might be able to do this by getting rid of the 'Project' folder and just having that component's files at top level.

permanent link
Sreerupa Sen (1.0k4) | answered Dec 05 '10, 1:03 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
The RTC Client for Visual Studio supports a Load Option where you can load components into root folders named after components - this is available via the Load wizard. You can also use the 'Load As' option on a component that allows you to load a component in a relative path of your choice under a sandbox.
We've also improved our share scenarios - you ca now directly share projects without having to share solutions. So in the simple case that you elaborated for example, you could share a project into a jazz component and the project folder would then become your top level folder.

permanent link
Michael Sternberg (8181) | answered Dec 06 '10, 3:35 a.m.
Thank you Nick and Sreerupa, looks like RTC is still geared very much to Java development.

'Create folders for components' is for build definition only, each developer will have to set up load paths in his local sandbox manually (once ? per workspace ? per development machine ?).

Also it's unacceptable to have all projects inside of top level folders for us.

And it's impossible to load component into folder under sandbox which is part of tree structure of another component (e.g. once we've loaded "Project" component into top level "Project" folder it impossible to load "client" component into "Project/client" folder..

Looks like we will start with a single component for all our projects and will wait for RTC 4.0 to solve this problem :(

Your answer


Register or to post your answer.