Reputation: 96859
I learned Java while ago. I just got bored of Java and returned to C++ after a while. I thought that C# was similar to Java. My assumption about the similarities between C# and Java was not correct after some reading about C#. I found many powerful concepts in C# that I love to see in Java. Anyway, much of what I read made sense to me except one thing. I keep hearing that C# is component oriented language! Wikipedia was really useless about this concept.
What does it mean in simple terms when you say, C# is component oriented language?! A simple example would be appreciated.
Upvotes: 30
Views: 37223
Reputation: 1
In just one line we can say it Component component-oriented programming means that C# has automatic ability of OOP, we cannot work in C# or Java without Object Oriented approch so such technique is built-in High level language. Thus this technique is called component-oriented.
Upvotes: 0
Reputation: 1
C# is an object-oriented language, but C# further includes support for component-oriented programming. Contemporary software design increasingly relies on software components in the form of self-contained and self-describing packages of functionality. Key to such components is that they present a programming model with properties, methods, and events; they have attributes that provide declarative information about the component; and they incorporate their own documentation. C# provides language constructs to directly support these concepts, making C# a very natural language in which to create and use software components.
Upvotes: 0
Reputation: 75
MAYBE I AM WRONG BUT I THINK:
I have read the same statement in e balagurusamy first chapter but there are no description about it but there is a line. C# is first component oriented language and in another line it describes C# is the only component oriented language today according to me I think the languages C and C++ are com based languages. It means they are completely depend on our operating system and every program register itself in registry of our operating system
In Java we don't have option to use C language (com based component) in our OOPs programming but if we talk about C# we can maybe that's why C# also called as a component oriented language
How we use:
Here you can see com tab
These are the dll made in C language
You can also add your C language dll by browse tab
Upvotes: 3
Reputation: 61713
I may be wrong, but here is how I see it: it means that the various parts of a system are separated from each other and can easily be replaced.
In dynamic languages it's relatively easy because of their flexibility, but in languages such as C# and Java you need to use special techniques such as dependency injection.
Upvotes: 1
Reputation: 55720
I'm sure that others here will be able to give a better explanation of what component oriented languages are (and if they won't, a thorough search on the internet should) but the way I see it the component oriented paradigm can be viewed as an embodiment of object oriented programming.
That is to say that component oriented programming specializes Object Oriented Programming by strictly enforcing and implementing some OO concepts. Basically the whole idea is to create reusable code - in the form of components - that can be interchanged. So, component oriented programming heavily relies on: polymorphism, encapsulation, late binding, inheritance (through interfaces) and most importantly binary re-usability.
A component is a software package that encapsulates data and functionality - much like an object in OOP - but at a higher level.
So, to say that C# is a component oriented language is basically to say that it is very well suited to be used to develop such software packages which we call components - but I feel that the fact that C# targets the .NET framework has a lot to do with the statement.
In reflection we could probable say that Java can be considered a component oriented language as well - although I have to admit I don't have a broad knowledge of Java.
Upvotes: 13
Reputation: 564413
I do not think of C# as a "Component oriented language". It is an object oriented language, which lends itself to being easily packaged into components.
I think it's more accurate to say that many of the development frameworks built upon .NET are component oriented frameworks. This makes C# development component oriented, if you're developing upon a component oriented framework. For example, ASP.NET and Windows Forms are heavily based upon a component conceptual model - everything is done via small components, worked together at design time.
However, you can easily develop in C# using little or no component orientation. The language itself doesn't provide this - other than enabling this style of development if you chose to use it.
Upvotes: 8
Reputation: 351516
I feel that the line between "component-oriented" and "object-oriented" is very blurry and in most cases it is safe to assume that they are the same thing.
That being said (and given the fact that I am unaware of your knowledge about object-oriented programming) I submit this excellent Wikipedia article for you to read:
Object-oriented programming (OOP) is a programming paradigm that uses "objects" – data structures consisting of datafields and methods – and their interactions to design applications and computer programs. Programming techniques may include features such as information hiding, data abstraction, encapsulation, modularity, polymorphism, and inheritance. It was not commonly used in mainstream software application development until the early 1990s. Many modern programming languages now support OOP.
You may also want to read Component-based software engineering which applies similar concepts across an entire system:
Component-based software engineering (CBSE) (also known as component-based development (CBD)) is a branch of software engineering, the priority of which is the separation of concerns in respect of the wide-ranging functionality available throughout a given software system. This practice brings about an equally wide-ranging degree of benefits in both the short-term and the long-term for the software itself and the organisation that sponsors it.
Components are considered to be part of the starting platform for service orientation throughout software engineering, for example Web Services, and more recently, Service-Oriented Architecture (SOA) - whereby a component is converted into a service and subsequently inherits further characteristics beyond that of an ordinary component.
Upvotes: 11