Amazines Free Article Archive
www.amazines.com - Thursday, June 20, 2019
Read about the most recent changes and happenings at Amazines.com
Log into your account or register as a new author. Start submitting your articles right now!
Search our database for articles.
Subscribe to receive articles emailed straight to your email account. You may choose multiple categories.
View our newest articles submitted by our authors.
View our most top rated articles rated by our visitors.
* Please note that this is NOT the ARTICLE manager
Add a new EZINE, or manage your EZINE submission.
Add fresh, free web content to your site such as newest articles, web tools, and quotes with a single piece of code!
Home What's New? Submit/Manage Articles Latest Posts Top Rated Article Search
Google
Subscriptions Manage Ezines
CATEGORIES
 Article Archive
 Advertising (133295)
 Advice (160822)
 Affiliate Programs (34734)
 Art and Culture (73674)
 Automotive (145654)
 Blogs (75021)
 Boating (9841)
 Books (17130)
 Buddhism (4124)
 Business (1328330)
 Business News (426310)
 Business Opportunities (366257)
 Camping (10957)
 Career (72763)
 Christianity (15841)
 Collecting (11636)
 Communication (115054)
 Computers (241948)
 Construction (38993)
 Consumer (49679)
 Cooking (17061)
 Copywriting (6567)
 Crafts (18204)
 Cuisine (7538)
 Current Affairs (20382)
 Dating (45774)
 EBooks (19685)
 E-Commerce (48195)
 Education (185188)
 Electronics (83491)
 Email (6390)
 Entertainment (159819)
 Environment (28933)
 Ezine (3038)
 Ezine Publishing (5443)
 Ezine Sites (1554)
 Family & Parenting (110898)
 Fashion & Cosmetics (196383)
 Female Entrepreneurs (11842)
 Feng Shui (130)
 Finance & Investment (310261)
 Fitness (105904)
 Food & Beverages (62850)
 Free Web Resources (7938)
 Gambling (30213)
 Gardening (25083)
 Government (10513)
 Health (629256)
 Hinduism (2206)
 Hobbies (44032)
 Home Business (91544)
 Home Improvement (251322)
 Home Repair (46116)
 Humor (4815)
 Import - Export (5450)
 Insurance (45126)
 Interior Design (29544)
 International Property (3485)
 Internet (190968)
 Internet Marketing (146305)
 Investment (22824)
 Islam (1168)
 Judaism (1357)
 Law (80460)
 Link Popularity (4592)
 Manufacturing (20840)
 Marketing (98747)
 MLM (14136)
 Motivation (18211)
 Music (26998)
 New to the Internet (9476)
 Non-Profit Organizations (4048)
 Online Shopping (129612)
 Organizing (7802)
 Party Ideas (11856)
 Pets (38081)
 Poetry (2234)
 Press Release (12670)
 Public Speaking (5618)
 Publishing (7522)
 Quotes (2407)
 Real Estate (126612)
 Recreation & Leisure (95254)
 Relationships (87450)
 Research (16157)
 Sales (80313)
 Science & Technology (110159)
 Search Engines (23446)
 Self Improvement (153090)
 Seniors (6230)
 Sexuality (35942)
 Small Business (49281)
 Software (82959)
 Spiritual (23461)
 Sports (116071)
 Tax (7658)
 Telecommuting (34064)
 Travel & Tourism (307189)
 UK Property Investment (3118)
 Video Games (13422)
 Web Traffic (11724)
 Website Design (56803)
 Website Promotion (36556)
 World News (1000+)
 Writing (35761)
Author Spotlight
ANISH SAH

My Name is Anish Sah, I am an Internet Marketing and SEO Expert, Social Media Guru and young Entrepr...more
ALFRED MEARS

Former English Teacher; Musician (20+ years); Freelance Writer ...more
SHOVON JOARDER

Shovon Joarder has been working as Freelance Marketing Project Manager for over four years. He also ...more
HANVEY HUANG

I'm a Chief Operated Officer from KIMKOO Mattress machinery.The pen is mightier than the sword.so I ...more
ROBERT HOWARD

The Word of God is as, “Sweet as Honey”. God has Taken Me Through a Whole Lot of Things...more


What Is An Interface? by Milecia McG





What Is An Interface? by
Article Posted: 01/02/2019
Article Views: 521
Articles Written: 24
Word Count: 557
Article Votes: 0
AddThis Social Bookmark Button

What Is An Interface?


 
Software,Website Design,Advice
If you plan on doing any back-end development, it's going to be important you know about interfaces. At first they seem kind of weird, but once you understand what they are you'll become more powerful than you've ever been.

You'll see interfaces a lot in C# because it doesn't let you inherit multiple classes. That's where interfaces come in. They let you implement the same methods and variables across different classes. An interface is kind of like a list of things that your class has to have.

When you use an interface on your classes, you have to write the implementation of the methods in your class. So you're probably wondering why you should even bother with interfaces if you still have to write separate implementation for everything.

It really comes down to the fact that you can't inherit multiple classes in C#. If you only need to inherit one class, you could use something like an abstract class. The thing that makes interfaces so powerful is the fact you can have multiple interfaces on the same class. That way when your code is compiling it knows what to expect at run-time.

Let me try using an example of an interface. Say you have a Chef class. It should have a method called Cook that can be used to cook any class of food that implements the ICookable interface. The Chef class shouldn't have a CookItalian, CookThai, or Cook(X) method for every kind of class that has the same basic operations.

Looking at this example it might not look like interfaces are much different from inheritance but there is a big difference. With inheritance, you are saying that your class is what it inherits. While an interface just says your class is implementing the methods in the interface.

Another thing that most people get confused about with interfaces is if they should be implemented by more than one class. Some of you might be saying that's not true, but hear me out. There's been a weird push to decouple every bit of code you possibly can and we do that by using interfaces.

If you go through some code, I bet you'll find that a lot of classes are only implementing one interface and none of the interfaces are the same. Have you thought about why that is? If you only have one class using a set of methods, why would you need a separate interface to do that?

For testing and dependency injection! That's why we use interfaces the way we do. It's not necessarily the "right" way to use them but it gets the job done. Interfaces really make testing easy because you can mock up stuff without needing to get rid of a lot of class dependencies. As for dependency injection, it's used to control which implementation of an interface should be used.

Interfaces are a little obscure until you work with them for a while and even then they're still weird. I just hope this helped bring you a little clarity about what they are and why we use them.

-----

I'm going to be taking the JavaScript tutorial down for some maintenance. Jan. 15th will be the last day you can download it for a while so you might want to go ahead and do that. Go get it here

Related Articles - web development, programming, beginners, csharp,

Email this Article to a Friend!

Receive Articles like this one direct to your email box!
Subscribe for free today!

 Rate This Article  
Completely useless, should be removed from directory.
Minimal useful information.
Decent and informative.
Great article, very informative and helpful.
A 'Must Read'.

 

Do you Agree or Disagree? Have a Comment? POST IT!

 Reader Opinions 
Submit your comments and they will be posted here.
Make this comment or to the Author only:
Name:
Email:
*Your email will NOT be posted. This is for administrative purposes only.
Comments: *Your Comments WILL be posted to the AUTHOR ONLY if you select PRIVATE and to this PUBLIC PAGE if you select PUBLIC, so write accordingly.
 
Please enter the code in the image:



 Author Login 
LOGIN
Register for Author Account

 

Advertiser Login

 

ADVERTISE HERE NOW!
   Limited Time $60 Offer!
   90  Days-1.5 Million Views  

 

Great Paranormal Romance

World News


STEPHEN BYE

Steve Bye is currently a fiction writer, who published his first novel, ‘Looking Forward Through The...more
LAURA JEEVES

At LeadGenerators, we specialise in content-led Online Marketing Strategies for our clients in the t...more
STEVERT MCKENZIE

Stevert Mckenzie, Travel Enthusiast. ...more
GENE MYERS

Author of four books and two screenplays; frequent magazine contributor. I have four other books "in...more
TREENA MURPHY

Warm greetings to you!! Hello there, my name is Treena (Smiley) Murphy I am a part time blogge...more
KIRAN KAUR

Kiranpreet (Kiran) Kaur, D.D.S., who received her Doctor of Dental Surgery degree from the prestigio...more
SUSAN FRIESEN

Susan Friesen, founder of the award-winning web development and digital marketing firm eVision Media...more
MICHAEL BRESCIANI

Rev Bresciani is the author of two Christian books. One book is an important and concisely written b...more
JAMES KENNY

James is a Research Enthusiast that focuses on the understanding of how things work and can be impro...more
LUMINHOME LIGHTING

About Us Luminhome Lighting provide one-stop services in lighting design and manufacture of LED lum...more

HomeLinksAbout UsContact UsTerms of UsePrivacy PolicyFAQResources
Copyright © 2019, All rights reserved.
Some pages may contain portions of text relating to certain topics obtained from wikipedia.org under the GNU FDL license