15,888,401 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by VermaManish (Top 8 by date)
VermaManish
8-Feb-12 13:03pm
View
I may not be clear enough in my last question. What I was trying to ask is, whether I can get reference of the type object of the class in which "MyClass" is declared as property?
VermaManish
8-Feb-12 5:28am
View
One more question before I start getting into details; is it possible to get the type of the instance in which my type "MyClass" is declared as property? I want to get this inside the "MyClass" class.
public class MyClass
{
private System.String mDescription;
public System.String Description
{
get
{
var stack1DeclaringType = //???
// stack1DeclaringType is expected to be typeOf(MyDeclaringClassA)
return mDescription;
}
set
{
mDescription = value;
}
}
}
VermaManish
2-May-11 3:17am
View
With pleasure! But it was Nishant's solution (Solution 3) that worked for me.
VermaManish
1-May-11 5:19am
View
This is perfectly valid in some cases. We could even use extension methods that can achieve the same pattern a little more elegantly. But let's agree to your argument that we should have bigger preference for language independent semantics. And so, your approach of using implementation helpers seems quite valid. But Nishant’s solution has one big advantage - we are able to encapsulate the implementation of our interfaces. This advantage of (encapsulated implementation) holds big relevance in case of my solution, even if it is at the cost of using language specific semantics. And after all, if everybody would avoid using language specific semantics, there wouldn’t be a need for second language. But I do really appreciate a good pattern that your solution manifests. Thanks
VermaManish
30-Apr-11 13:31pm
View
I think your solution is par excellent!
I'll have to do few more tests related to serializing the generic EducatedAdult, before I come back.
Thanks!
VermaManish
30-Apr-11 12:51pm
View
Who me? No! Its Lord Krishna who's everywhere - The Omnipresent! :)
VermaManish
30-Apr-11 6:23am
View
Hi Albin,
Nice to see you here. But I am still looking for a better design.
Thanks
Manish
VermaManish
30-Apr-11 6:22am
View
The application that shall use these objects identifies the interfaces (IAdult, IEducated) only. So I need to implement these contracts to make these objects (Carpenter, Programmer, Plumber) usable.
Show More