Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

DLL's in C#

  • 27-01-2005 1:09am
    #1
    Closed Accounts Posts: 807 ✭✭✭


    ok got to do a bank account system for uni

    only just got it so im not actually going ahead and programming (struggling) yet

    but i was looking on our c' wiki about how we are suppose to do it and im not understanding this new way of testing..its involving using a library or something and a .dll file which gets bits from the main program..or is the main program the dll

    argh..can anyone give me a quick run down on how this .dll and library work?

    oh and we are using "class" now..even though all how programs have had the word class in..whats the difference now i know i cant explain much to you as we dont have all our notes up online yet just this way of testing using different source files is mighty confusing..can anyone shed some light?

    :confused:


Comments

  • Registered Users, Registered Users 2 Posts: 2,426 ✭✭✭ressem


    I'll try to start this, sorry if I'm oversimplyfying...

    All c# is usually part of a class, but using classes in real life involves not writing all your code as one big class file that does everything, as it's hard to read and fix. You examine the problem, and look at how you can break the solution into objects, groups of methods and data that have a strong dependence on each other.

    So a bank account system problem description might go like
    CUSTOMER wants to withdraw money from BANK ACCOUNT
    to do this
    CUSTOMER authenticates herself by inserting ACCOUNT CARD into ATM and entering PIN to ATM.
    ATM sends PIN to ACCOUNT CARD.
    ACCOUNT CARD validates PIN to ATM
    ATM displays options to CUSTOMER
    CUSTOMER tells ATM to withdraw MONEY from BANK ACCOUNT
    ....

    So you choose the nouns that you want to implement as classes, and the verbs which will be methods, note be selective, you don't need to implement every object as a class which can make things overcomplicated.


    Such as ATM with public methods like
    initialise ATM for transaction
    display options to customer


    and private methods like
    get PIN
    get amount to withdraw
    check for approval against BANK ACCOUNT
    set PIN state to valid or invalid


    And ACCOUNT CARD with public method
    validate card (PIN)

    So ATM could be a class, and ACCOUNT CARD could be a class, and each could be placed in a DLL, to clean up the main file.


    A dll is a a Dynamic Link Library. You'll write one or more of these to store methods and classes to use in various programs.
    To test each public method provided by the DLL, you can import this DLL's functionality into a normal executable that you create specifically to run each method with sample data.


    If this is no help, this new way of testing, can you clarify? Were you asked to use something called nUnit to create automated tests for each function perhaps.


  • Closed Accounts Posts: 807 ✭✭✭ViperVenoM


    ohhh i see i think...its just something new that i dont quite understand....and i want to try and figure it out before i struggle with my program..that does make a little sense cheers :)

    we was told about nUnit a while back i think..is that the program that will run tests and give you a green light if it passes or something..i think the lectuer had it running once but no ones seen it since :confused:


Advertisement