Regarding multiple inheritance - multiple-inheritance

Can anyone explain me
why c# not supporting multiple inheritance since c++ supporting multiple inheritance ? how it is possible ? How c++ supports ?

First, a small correction: C# does support multiple interface inheritance. It doesn't support multiple implementation inheritance.
The two big reasons MI isn't supported are:
Chances are good that you can do what you want with multiple interface inheritance anyway.
It adds a lot of complexity to the compiler implementation.
IMO, in many cases, the availability of multiple inheritance in a language causes that feature to be frequently abused. Single inheritance already gets wedged into a lot of class hierarchies unnecessarily when something like composition would do just as well.

From an MSDN blog on C# frequently asked questions you can find this answer. There is also this highly rated Stack Overflow question.

Related

How is abstraction realised in a system?

Some say abstraction is achieved through abstract class, while others say it is achieved through encapsulation. I am confused, would someone advise?
'Abstraction' is a very vague word covering many.many ideas in programming (and system design)
abstract classes are a very concrete mechanism in some languages.
encapsulation is a common object oriented design pattern used in some languages
Are these 2 models used for abstraction, yes. Are they the only ones, no.

Is there a name for the pattern of injecting implementations into a portable class library?

Apologies for the not entirely code related question.
I am in the process of building a WPF application with a View Model Locator pattern. In that I have interfaces to represent functionality not present in portable class libraries.
I then assign those properties concrete values in my application so that they are available for injection to my view models.
My question is, do we have a name for this pattern? It seems a standard enough way to do this but I am never sure what to call it and end up having to explain it every time.
A term Microsoft uses to describe the way one can inject in a PCL concrete implementations of code that cannot be written to directly target a PCL is platform abstraction.
There are several techniques to achieve this. Here are some useful links:
http://blogs.msdn.com/b/dsplaisted/archive/2012/08/27/how-to-make-portable-class-libraries-work-for-you.aspx
http://blog.stephencleary.com/2012/11/portable-class-library-enlightenment.html
http://log.paulbetts.org/the-bait-and-switch-pcl-trick/

IoC Container for WPF application

I'd like to start using IoC Container in an existing WPF application.
I need good performance, but from what I read, performance is really not an issue with most containers.
What I need most is a very easy to use container, that can be easily integrated into my app. I read recommendations about StructureMap (and the syntax looks great), but in their site it seems that there were no updates in the last 3 years, so I'm having some doubts about it.
Please provide recommendations with basic usage code samples (initialization + usage).
Edit
I'm not looking for a complete framework. I only need the IoC container ability, so many other alternatives exist. The last relevant discussion I found here is a few years old and I'd like to refresh it.
The answer really depends on personal preference and the details of your use case. Anyway, after using Unity, MEF (I know, not a real IoC container) and writing some individual solutions, I am now using Autofac and like it a lot. It is very easy to dig into and continuously reveals its advantages the longer you use it. It provides a fluent interface and is fast, compared to other frameworks (btw: The performance of your container can be a very important issue, depending on what you want to do). For usage and samples of Autofac see the link above.
Why I like it:
Easy to get into
Fluent interface
Supports open generics
Supports assembly scanning
Interoperability with MEF and other frameworks
Fast enough (Performance comparison of IoC containers)
Still, this is personal choice and there are other good solutions around, which might even be better for your special case.
And, more or less off-topic, I can recommend this article, especially the second half, for general considerations. It helped me a lot. So, just in case:
Article by Martin Fowler
Structuremap aint dead.
We are using it for our new green field project, and when v3 is out we may migrate to it. ATM using 2.6.4.
Your question is a shopping-list type question so it won't stay open long.
There are a number of IoC type frameworks, some of which require declarative or programmatic manipulation to do their work, some of which use code semantics to wire things up.
I would suggest you start with Unity1 until you get into the swing of things, then look to branch out into some of the more exotic frameworks when you can appreciate the differences between them.
1 Here is a good recent intro article: Visual Studio magazine: Creating Modularity with WPF, Prism and Unity

Aspect Oriented C (not C++) in Production Code

This is a question further derived from a previous one: https://stackoverflow.com/questions/1834485/aspect-oriented-programming-aop-in-c-not-c-anyone-doing-it
The answers to that question point us to some research practices at queens university here:
http://sailhome.cs.queensu.ca/~bram/aspicere/index.html.
Beyond that research effort, does anyone know of real world usage of Aspect Oriented C in production code? If no, where do you think the difficulty is? If yes, what's the hurdle that makes it unpopular yet?
I think the benefit of AOP is obvious. But after AOP-Java becoming popular for a decade, AOP-C is still almost non-existent, there must be some reason. What's your insight on this?
After some thinking I believe the answer is that C lacks the structural constructs where you can hook up your aspect cross-cuts.
To get around of this problem, a project would have to impose strict structural conventions that is not easy to have programmers to agree on. If you do have programmers to agree on to such a convention, the chance is that the project would have chosen a better language.
I think the main reason is that traditional method to implement the AOP in C/C++ needs a complex framework to make things work.
Beside, the C++ is strict type language, which makes the implementation even harder than C.
But, It is the old time. new C++ 11~17 provides some really powerful features for you to do all the tricks.
You could check this one: https://github.com/whitebob/qaop
A very light-weight, header-only AOP framework, and it is easy to use.
I am the author of this on-going project, so if you have some suggestions or complains, just contact me :p

Ways to get past the Inner-platform effect while still building highly customized web apps?

Feel free to answer the question in the title as generally as I posed it, I offer some more details and specifics below.
Currently I develop and maintain a somewhat legacy business app (ASP/SQL) that is highly customizable allowing for moderate to full customization on: custom fields, forms, views, reports, actions, events, workflows, etc. This customization is necessary in the domain we develop for and has allowed us to build a niche.
I have been reading up on the inner-platform effect and ways of implementing high level user defined customization and have concluded that we do suffer from many of the inner-platform effect problems because essentially we have created a high level abstraction on top of the SQL. The organization of custom fields is implemented in a similar way to the approach found here
http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/
We use something similar to the meta database method described in that article. All customization is built around this approach and in many ways we suffer from database on top of a database.
The end result is something that looks fantastic on paper yet the more features are added and custom coding is done for clients the more of a mess everything becomes. It seems that the more I read the more I realize this is somewhat of an anti-pattern. It also seems that the more I try to read the more I find so little has been written on the topic. Anyways, I am trying to learn modern approaches to this problem and trying to find more discussion/articles on the topic. Are Database systems such as CouchDB relevant to this type of application?
My question is clearly pretty general. It seems like there is a lot against this kind of application in favor of just "knowing and defining your domain better". Are there any good/better ways to implement this kind of application? I'm not looking for black and white answers, and any further readings on the subject would be fantastic. Thanks for any help.
My answer is be conscious and clear about what is for a plugin to do and what is a user setting. In that case, your platform and your settings are different. Your application provides basic services and is unabashedly a platform. It may also provide an application built on that platform.
So in that case you focus on programmer interfaces instead of implementation possibilities.
The standard advice in CS is to create another level of abstraction, not sure if that's not the problem here.
The only advice I could give is to push as much functionality onto the database, given it's the platform. SQL Server supports custom functions, fields and stored (SQL) procedures.
Either that or try to pull repeated functionality into separate functions in ASP.

Resources