468,249 Members | 1,488 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Howto :: Class implementation on several files...

In the good old days , i had a class that had 30 functions (let's say)
There was a single include(*.H) file and i could have several
implementation(*.CPP) files
The reason for doing this is to have some functions grouped so it is easier
to read/manage them...
Maybe several developers work on the same class but on different parts of it
in parallel...

I have a C_foo class
foo.h // the header file that has the C_foo class...
foo_1.cpp // 1st part of the implementation of C_foo class
foo_2.cpp // 2nd part of the implementation of C_foo class
foo_3.cpp // 3rd part of the implementation of C_foo class

By this way developer_1 checks-out foo_1.cpp , works on it and then
checks-in , etc..
How can we do the very same thing under .net/C# language ???
Thanks in advance...
Nov 15 '05 #1
4 1337
Malkocoglu,

Unfortunately this isn't available at the moment, although it is planned for
the next version of .NET (think its going to be called partial types)

HTH

Kieran

"Malkocoglu" <a@b.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
In the good old days , i had a class that had 30 functions (let's say)
There was a single include(*.H) file and i could have several
implementation(*.CPP) files
The reason for doing this is to have some functions grouped so it is easier to read/manage them...
Maybe several developers work on the same class but on different parts of it in parallel...

I have a C_foo class
foo.h // the header file that has the C_foo class...
foo_1.cpp // 1st part of the implementation of C_foo class
foo_2.cpp // 2nd part of the implementation of C_foo class
foo_3.cpp // 3rd part of the implementation of C_foo class

By this way developer_1 checks-out foo_1.cpp , works on it and then
checks-in , etc..
How can we do the very same thing under .net/C# language ???
Thanks in advance...

Nov 15 '05 #2
Malkocoglu,

You can not do this currently in C#. You must place the complete
implementation in a single class file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Malkocoglu" <a@b.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
In the good old days , i had a class that had 30 functions (let's say)
There was a single include(*.H) file and i could have several
implementation(*.CPP) files
The reason for doing this is to have some functions grouped so it is easier to read/manage them...
Maybe several developers work on the same class but on different parts of it in parallel...

I have a C_foo class
foo.h // the header file that has the C_foo class...
foo_1.cpp // 1st part of the implementation of C_foo class
foo_2.cpp // 2nd part of the implementation of C_foo class
foo_3.cpp // 3rd part of the implementation of C_foo class

By this way developer_1 checks-out foo_1.cpp , works on it and then
checks-in , etc..
How can we do the very same thing under .net/C# language ???
Thanks in advance...

Nov 15 '05 #3
As Nicholas said you can't currently split a class up over several files but
you can group parts of the class up by using the #region directive. With
regards to multiple developers working off of the same file you will
currently have to rely on mulitiple checkouts on the same file and then
merge the differences when you check in.

Regards
Lee

"Malkocoglu" <a@b.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
In the good old days , i had a class that had 30 functions (let's say)
There was a single include(*.H) file and i could have several
implementation(*.CPP) files
The reason for doing this is to have some functions grouped so it is easier to read/manage them...
Maybe several developers work on the same class but on different parts of it in parallel...

I have a C_foo class
foo.h // the header file that has the C_foo class...
foo_1.cpp // 1st part of the implementation of C_foo class
foo_2.cpp // 2nd part of the implementation of C_foo class
foo_3.cpp // 3rd part of the implementation of C_foo class

By this way developer_1 checks-out foo_1.cpp , works on it and then
checks-in , etc..
How can we do the very same thing under .net/C# language ???
Thanks in advance...

Nov 15 '05 #4
Malkocoglu,
Consider using Method Objects to move the implementation of the methods into
their own class.

http://www.refactoring.com/catalog/r...hodObject.html

Each method (most methods) of the C_foo class becomes their own class, that
C_foo calls into to get the work done.

The problem with this approach is that these method object classes may need
'intimate' knowledge of the C_foo class.

I find method objects work better for Web Services & Remoting Servers,
making the Web Service or Remoting Server a facade.

Hope this helps
Jay
"Malkocoglu" <a@b.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
In the good old days , i had a class that had 30 functions (let's say)
There was a single include(*.H) file and i could have several
implementation(*.CPP) files
The reason for doing this is to have some functions grouped so it is easier to read/manage them...
Maybe several developers work on the same class but on different parts of it in parallel...

I have a C_foo class
foo.h // the header file that has the C_foo class...
foo_1.cpp // 1st part of the implementation of C_foo class
foo_2.cpp // 2nd part of the implementation of C_foo class
foo_3.cpp // 3rd part of the implementation of C_foo class

By this way developer_1 checks-out foo_1.cpp , works on it and then
checks-in , etc..
How can we do the very same thing under .net/C# language ???
Thanks in advance...

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Logan | last post: by
21 posts views Thread by Jon Slaughter | last post: by
3 posts views Thread by Matthias Kaeppler | last post: by
8 posts views Thread by Topper | last post: by
13 posts views Thread by Ben Voigt [C++ MVP] | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.