locked
Assemblies, classes and references RRS feed

  • Question

  • Hello

    I'm a Visual Basic learner on Microsoft Visual Academy.

    I have some troubles with 3 concepts: assembly, classes and references.

    I wonder there are any differences among them? 

    In advance, thanks for help.

    Jay Bubble
    Sunday, October 11, 2015 1:54 AM

Answers

  • Hi Jay,

    An assembly is the compiled output of your code, typically a DLL, but your EXE is also an assembly. It's the smallest unit of deployment for any .NET project.
    The assembly typically contains .NET code in MSIL (Microsoft Intermediate language) that will be compiled to native code ("JITted" - compiled by the Just-In-Time compiler) the first time it is executed on a given machine. That compiled code will also be stored in the assembly and reused on subsequent calls.
    The assembly can also contain resources like icons, bitmaps, string tables and so on. Furthermore, the assembly also contains metadata in the assembly manifest - information like version number, strong name, culture, referenced assemblies and so forth.
    Please refer MSDN article for more information,
    Assemblies and the Global Assembly Cache (C# and Visual Basic)

    When you define a class, you define a blueprint for a data type. This does not actually define any data, but it does define what the class name means. That is, what an object of the class consists of and what operations can be performed on that object. Objects are instances of a class. The methods and variables that constitute a class are called members of the class.
    Please refer MSDN article and some more useful articles for more information,
    Classes (C# Programming Guide)
    Defining a Class
    http://www.dotnetperls.com/class

    Reference types store the address of their data, also known as a pointer, on the stack. The actual data that the address refers to is stored in an area of memory called the heap. Because reference types represent the address of the data rather than the data itself, assigning a reference variable to another doesn’t copy the data. Instead, assigning a reference variable to another instance creates a second copy of the reference, which refers to the same location of the heap as the original value.
    Please refer MSDN article and some more useful articles for more information,
    ref (C# Reference)
    http://www.dotnetperls.com/ref
    Reference and Value Types in C#

    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    • Proposed as answer by pvdg42 Sunday, October 11, 2015 11:59 PM
    • Marked as answer by Thong Nguyen Thanh Monday, October 12, 2015 2:36 PM
    Sunday, October 11, 2015 7:21 PM