473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1547
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
15
by: Mon | last post by:
I am in the process of reorganizing my code and came across and I came across a problem, as described in the subject line of this posting. I have many classes that have instances of other classes...
13
by: ronic | last post by:
I am creating a big class. and I want to define in different files for this class. How to do it? Thanks.
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
3
by: Matthias Kaeppler | last post by:
Hello, this more a question about good practice than it is about the C++ language itself, but still... my question is this: I have a class representing the main window of my application which...
9
by: Codex Twin | last post by:
Hi I have a common model for a Data Access Layer scenario. I have an abstract base class, called DalBase which contains a list of abstract methods. Lets call them: public abstract void Shine();...
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
8
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do...
13
by: Ben Voigt [C++ MVP] | last post by:
This is more of a C# question than a C++ question, but my best chance of explaining it is via comparison to C++. Ok: In C++ you can forward declare a type. Then references to that type can be...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.