|
Hello world!
I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help.
I would like to expose an...
Started by Statement on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Unsure about what you mean by "not exposing std::vector publicly" but indeed, you can just define.
|
|
Hi everyone,
I am currently coding a simple Data Access Layer, and I was wondering which type I should expose to the other layers.
I am going to internally implement the Data as a List<>, but I remember reading something about not exposing the List...
Started by Luk on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
IList is good, but sometimes you may need ICollection....
Which interface depends on the circumstances.
Using an interface will reduce coupling and make it easier to change details of your data layer's implementation down the road .
Definitely an ISomething.
|
|
Hi, we're considering exposing some C# types to C++ clients via COM. What problems can we expect to hit over the life of the project? E.g. how will versioning be managed?
On versioning, it would seem from reading this that we should decorate our types...
Started by ng5000 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The only way to version an interface ....
Dispatch interfaces are useful when using scripting clients such as VBS but they are rarely useful for C++ clients .
Since you are using a C++ client you should definitely use explicit interfaces for early binding .
|
Ask your Facebook Friends
|
How do I expose a class from a dll ?
The application importing the dll should be able to create the objects of the class and also he should be able to call into the member functions of the class .
Is it similar to exposing C type functions using _declspec...
Started by Rakesh Agarwal on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
And the __declspec can be applied.
To exposing C type functions using _declspec(dllexport) ?
Yes.
|
|
I often come across web applications that expose internal database primary keys through forms like select boxes. And occasionally I see javascript matching against an int or guid magic value that switches the logic.
Is is a best practice to avoid leaking...
Started by Ryu on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Yes, exposing that exposing primary keys is....
Not so with a generated key.
This is one instance where exposing a PK would "break" an app unrelated to the security of the app.
To that data would now point at a different set of data .
|
|
I am new to C#.I wish to know the differences of using Collections. I suspect ,the following question may be asked before(If so kindly show me the link).
What is the Difference between
IList<int> intCollection = new List<int>();
and
List<...
Answer Snippets (Read the full thread at stackoverflow):
The two lines in your example amount to the same thing, but if you expose IList<T> as a property, you can change exactly what gets returned without....
Using an interface allows you to change the backing implementation without breaking any callers .
|
|
I've heard that exposing database IDs (in URLs, for example) is a security risk, but I'm having trouble understanding why.
Any opinions or links on why it's a risk, or why it isn't?
EDIT: of course the access is scoped, e.g. if you can't see resource ...
Started by orip on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
And, in practice, it would be extremely burdensome to design a web... .
As little information about the inner workings of your app to anyone."
Exposing the database ID counts the proper conditions, exposing identifiers is not a security risk.
|
|
I have some object classes that use inheritance. It seems that I can only get access to the objects that are directly used by a service. Let me show you what I am trying to accomplish:
[DataContract] public class Object1 { [DataMember] int Id {get; set...
Started by DDiVita on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It is always better to expose the minimal set of data required.
Then you shouldn't be exposing them.
|
|
I have been given two different Microsoft Word document that my virus scanner has warned me contains macros. These should be simple text files, and the person who sent them doesn't even know what a macro is; they may be a mistake on his part, but they...
Started by Dustman on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Then load up the document and let the macros run... .
Get yourself a free copy of VMWare player and install Windows and MS Office within it .
Two possibilities.
Just open the document without activating macros, then open the code editor to see what they do .
|
|
I know I shouldn't be exposing a List<T> in a property, but I wonder what the proper way to do it is? For example, doing this:
public static class Class1 { private readonly static List<string> _list; public static IEnumerable<string>...
Started by Michael Stum on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
Exposing a List<T> as a property isn't actually the root of all evil; especially if it allows.
|