473,406 Members | 2,345 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,406 software developers and data experts.

Interface

Hi !
I got a user interface named "IProduit"
Then, I declare a new instance of this interface : Produit = New IProduit

Now, I'd like to have a "clone" of the object Produit. I don't want these
two objects ( Produit and Produit2 for example ) to share the same pointer,
but I want them to have the same data ( I have a dataset into the
interface ).

How can I proceed ?

Thank You !

Jeff
Nov 20 '05 #1
15 1216
Hi Jeff, (J-F?)

You can't instantiate an Interface so this should be illegal.
Produit = New IProduit

So I have to wonder what IProduit <is>.

Assuming that it is actually a class, (but please correct me), you have a choice of doing a shallow clone or a deep
clone. And now I'm into deja-vu.

This topic was extensively covered recently.
Topic: How do I implement ICloneable?, dated 4th Nov

Regards,
Fergus
Nov 20 '05 #2
* "Jean-Francois Cantin" <je*****************@expertisa.com> scripsit:
I got a user interface named "IProduit"
Then, I declare a new instance of this interface : Produit = New IProduit
You cannot instantiate an interface.
Now, I'd like to have a "clone" of the object Produit. I don't want these
two objects ( Produit and Produit2 for example ) to share the same pointer,
but I want them to have the same data ( I have a dataset into the
interface ).


Implement 'ICloneable'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3
He's asking <how>. 'Implement ICloneable' says nothing.
Nov 20 '05 #4
Hi !
Btw, yeah my name is J-F ;-)
Ok, I made an error when I wrote my email.
Let's me explain with more details.

I got an interface ( IProduit ). This interface contains properties and a
dataset <this dataset contains some datatables>
These datatables are filled when I call the New method on the class Produit.

I'd like to create a new "IProduit", but I don't want this new object to
fill its datatables. I wanna make a real copy of the object ( the first
IProduit ), with datas. By this way, I should be able to avoid the long
"data retreiving process".

J-F ( ;-) )

"Fergus Cooney" <fi****@post.com> a écrit dans le message de
news:u%****************@TK2MSFTNGP09.phx.gbl...
Hi Jeff, (J-F?)

You can't instantiate an Interface so this should be illegal.
Produit = New IProduit

So I have to wonder what IProduit <is>.

Assuming that it is actually a class, (but please correct me), you have a choice of doing a shallow clone or a deep clone. And now I'm into deja-vu.

This topic was extensively covered recently.
Topic: How do I implement ICloneable?, dated 4th Nov

Regards,
Fergus

Nov 20 '05 #5
* "Fergus Cooney" <fi****@post.com> scripsit:
He's asking <how>. 'Implement ICloneable' says nothing.


It says nothing to _you_.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #6
I know how to implement ICloneable.

The statement 'Implement ICloneable' does not tell anybody how to do so.

Like when I say to you 'look at your own behaviour' - you don't know what it means.
Nov 20 '05 #7
Hi J-F, ;-)

Did you check out the topic on Clone that I gave you. It says a lot of stuff that I don't want to repeat - we only
wrote it a day or so ago. Also check out your Help - it will hopefully say the same in a different way, and give you a
rounder picture. Once you've had a look at that topic, come back and tell us your ideas.

You would be wanting a deep Clone. DataSets can clone themselves but they can't clone their data. You'd have to do that
bit by hand.

I'm still confused by the Produit versus IProduit, but that may not matter.

Regards,
Fergus
Nov 20 '05 #8
* "Fergus Cooney" <fi****@post.com> scripsit:
I know how to implement ICloneable.

The statement 'Implement ICloneable' does not tell anybody how to do so.


It doesn't tell _how_ to do, but it tells _what_ to do.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #9
|| It doesn't tell _how_ to do, but it tells _what_ to do.

It doesn't even do that!!

Implementing ICloneable is not necessary for Cloning.

Given that the original question is asking how to clone, you are answering with the question!

How do I tell Herfried he's got it wrong?
Easy - you just tell Herfried that he got it wrong.

It doesn't say anything new. At all. In both cases of 'it'.
Nov 20 '05 #10
* "Fergus Cooney" <fi****@post.com> scripsit:
|| It doesn't tell _how_ to do, but it tells _what_ to do.

It doesn't even do that!!

Implementing ICloneable is not necessary for Cloning.

Given that the original question is asking how to clone, you are answering with the question!


[ ] You understood it.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #11
Cor
Herfried and Fergus,
May I have the last message in this thread,
I don't need an answer
:-))

Cor
Nov 20 '05 #12
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote...
* "Fergus Cooney" <fi****@post.com> scripsit:
He's asking <how>. 'Implement ICloneable' says nothing.


It says nothing to _you_.


Like most of your replies it says nothing to most people. But don't let the
facts get in the way of a good story.

But I have a solution...

"Implement IUnderstandable"
Nov 20 '05 #13
* "Tom Leylan" <ge*@iamtiredofspam.com> scripsit:
He's asking <how>. 'Implement ICloneable' says nothing.


It says nothing to _you_.


Like most of your replies it says nothing to most people.


Good that _you_ and _Fergus_ know that.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #14
I think you might have misunderstood...
We all recognize your need to be the policeman in the group.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote...
* "Tom Leylan" <ge*@iamtiredofspam.com> scripsit:
He's asking <how>. 'Implement ICloneable' says nothing.

It says nothing to _you_.


Like most of your replies it says nothing to most people.


Good that _you_ and _Fergus_ know that.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #15
Fergus,
You'd have to do that bit by hand. If you use DataSet.Copy, Datasets can clone their data & structure! (no need
to do it by hand).

Where as if you use DataSet.Clone, Datasets can only clone their structure.

Hope this helps
Jay

"Fergus Cooney" <fi****@post.com> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl... Hi J-F, ;-)

Did you check out the topic on Clone that I gave you. It says a lot of stuff that I don't want to repeat - we only wrote it a day or so ago. Also check out your Help - it will hopefully say the same in a different way, and give you a rounder picture. Once you've had a look at that topic, come back and tell us your ideas.
You would be wanting a deep Clone. DataSets can clone themselves but they can't clone their data. You'd have to do that bit by hand.

I'm still confused by the Produit versus IProduit, but that may not matter.
Regards,
Fergus

Nov 20 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roy Pereira | last post by:
I have an application that is composed of a set of "Content" dlls and a viewer application. The viewer calls a standard set of functions that are present in all the dlls. I maintain this by...
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
4
by: Doug | last post by:
I am working on an existing .NET (C Sharp) component that had a com interface that was used by a VB component. When it was originally written, it had the SSEAssemblyCom class below - minus the two...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
6
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
2
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators ","...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interfaceâ€. In a functional language, a function can be specified by its name and parameter specs....
8
by: rn5a | last post by:
Suppose I have the following class code: Imports System Imports System.Data Imports System.Data.SqlClient Public Class DBSettings Private sqlCmd As SqlCommand Private sqlConn As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.