Click here to Skip to main content
15,885,707 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to creating a chat application in windows phone 8.1 using xmpp and openfire server in visual studio 2013 updated 4.I l.For xmpp connection to servr i used these dll

.phonesocketserver.dll
.phone.xmpp.dll

For my chat application i want use more specifications like fileupload,downlod,camera,mp3 etc. For adding these features ,should I add all dll of these or its source code?

1.what is the diffrence between adding just dll file and adding source code of that particular dll?
2.How can we add more features in to dll source code?
3.Is there any thing like JAR file in .NET??
4.NuGet is just like that?

please help me..
Posted
Updated 6-Oct-15 0:29am
v2

1 solution

Hi,

There are a lot of question here, but I'll try to answer as best I can.

"...should I add all dll of these or its source code?"
Unless the dll is very large and you need just a snippet of the code, add the whole dll. There's no point stirring up the silt. Keep you code modular.


"1.what is the difference between adding just dll file and adding source code of that particular dll?"
If you add the source code in the form of a project there is functionally no difference. Each project in your solution compile to single dlls (or exe's or whatnot). It is only useful for debugging so you can understand what happens in the dll at run-time.


"2.How can we add more features in to dll source code?"
You could, but don't. There's no need. You can create an API (middle-ware) dll that extends the functionality of the first and projects the core functionality you need. This is a very tidy way to code. Unless they have sealed the classes, you can inherit from them to add functionality.


"3.Is there any thing like JAR file in .NET??"
Sort of, but not really. It is possible to encase your assemblies (dlls etc) into something like a cab file, but there isn't any need.
Jar files take .java files and put them into a single file. .Net compile all .cs files into a single assembly (eg dll) anyway.


"4.NuGet is just like that?"
NuGet is a way for devs to "package" assemblies. This only means that they can ensure dependency assemblies are present. It still downloads each assembly separately. Look at packages.config in your project. This is used by nuget and VS to ensure that the relevant assemblies are downloaded before it compiles.

I hope that helps. If you have any questions about these answers then please comment below

Good luck ^_^
Andy


UPDATE: Answer to "How can I add features to a dll.

A dll or Dynamic Link Library is just another assembly. An assembly contains classes. Take a look at the example project below:

Project Base
C#
namespace Base
{
    private class ThisIsPrivate{}
    public sealed class ThisIsSealed{
        public int GetInt()
        {
            //...
        }
    }
    public class ThisIsInheritable
    {
       public string CreateFileContent()
       {
            //...
       } 
       public virtual bool SaveFile(string fileContent)
       {
            //...
       } 
    }
}


Imagine that this assembly is in a file called Base.dll. Some of the classes we can extend, some we can't:

MyExtendingClass:
C#
//We can't see private classes so we can't inherit from it
//private class ThisIsPrivate : Base.ThisIsPrivate{}

//We can't inherit from sealed classes, but we can use them
//public sealed class ThisIsSealed:Base.ThisIsSealed{}
public sealed class ThisIsSealed{
    //We must expose the methods instead
    Base.ThisIsSealed baseSealed = new Base.ThisIsSealed();
    public int GetInt(){
       return baseSealed.GetInt();
    }
    //now we can extend it:
    public int IntPlusInt(int p){
        return baseSealed.GetInt() + p;
    }
}

//The there are standard classes - we can inherit from this:
public class ThisIsInheritable:Base.ThisIsInheritable{

      //all of the functionality of Base.ThisIsInheritable is exposed
      //We can even take over some of that functionality:

      //We can use the new keyword:
      new public string CreateFileContent(){
          //access the inherited type with base, otherwise this is recusive
          return base.CreateFileContent();
      }
      //Or we can override virtual methods.  This keyword means that it is designed to be overridden:
      public override bool SaveFile(string fileContent){
              return base.SaveFile(fileContent);
      }

      // then we can add out own extended funcionality, mixing inherited, overridden and new methods:
      public bool CreateAndSaveFile(){
          return base.SaveFile(CreateFileContent());
      }
}


I hope that clarifies things
Andy
 
Share this answer
 
v2
Comments
[no name] 6-Oct-15 6:48am    
should i add all relevant dll into NuGet frame work? If yes can i able to use this single nuget package for all specification?
Andy Lanng 6-Oct-15 6:54am    
You would need a separate NuGet package for each spec.
Alternatively, you could just give them all specs in one package. VS will only include dlls that are actually referenced. You can tell them in the readme to remove the required ones :/
[no name] 6-Oct-15 6:57am    
is there anyway or sugest to use all dll's(to add more features)in a single package or frame work that i can use
Andy Lanng 6-Oct-15 6:59am    
For what reason? What is your goal? I need to know because it will effect my answer ^_^
[no name] 6-Oct-15 7:06am    
i created a simple chat application.if i add one dll(eg:phone.socket.dll)i cant add more features in to that.instead of this,i downloaded source code of that dll and trying to save.How can I save that source code into my project ?and that should be able to add more features

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900