Page 3 of 7 FirstFirst 123456 ... LastLast
Results 21 to 30 of 70
  1. #21

    Default Re: Interfaces in Object Oriented Programming


    Quote Originally Posted by canobic View Post
    @yanong_banikanhon, as to your question what a Factory pattern is and what IOC is, well... there are plenty of resources available in the web. A simple Google search will do the trick. But here's a simple example...

    Consider the difference when using the Factory pattern:
    ....

    And this one with (IOC) Dependency Injection in Spring...
    Bay canobic, ang rason maong nangutana ko sa imo sa kalainan sa Factory ug IoC is because you are mixing these things together. Please have a look at your example above. I specifically asked you about IoC but you gave an example on DI (dependency injection). Maglibog gyud ang mobasa ana, bay. Gawas kun imong i-explain ang koneksyon aning duha. Mao nga since na-mention naman nimo dinhi ang Factory pattern, Inversion of Control ug Dependency Injection , please explain these terms in layman's terms. Unsa ang kalainan aning tulo? Unsa may koneksyon nila sa interface?

    Kun atong matubag ng mga pangutanaha, siguro daghan pud ang makat-on (inay malibog) dinhi. Please don't just provide wikipedia or google link just like the other poster have done.

  2. #22

    Default Re: Interfaces in Object Oriented Programming

    @yanong_banikanhon, I don't know how else to make it simpler for you.

  3. #23

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by yanong_banikanhon View Post
    If you have an implementation class whose Log() method achieves the opposite (for example, delete a log entry from a database), you cannot safely call iLogger.Log(). You have to check first what kind of ILogger you currently have. As silly as it may sound, this is the same scenario as MyPatriot & MyTerrorist. You have two opposing operations and you managed to hide it using MyWarInterface. This makes the life of the consumer of your API a little bit more difficult.
    Oh my goodness... Why would you as the developer blindly inject or instantiate the 'delete log' class to your interface if that's not what you want?

  4. #24

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by canobic View Post
    Oh my goodness... Why would you as the developer blindly inject or instantiate the 'delete log' class to your interface if that's not what you want?
    That is exactly my point. No developer would blindly (or intentionally) instantiate that class. So all the developers who are going to use your API will have to make it 100% sure that they instantiate the proper class. They need to know the details of the implementation classes. This makes their lives a little bit more difficult and effectively DEFEATS the purpose of using interface in the first place.

    Now going back to Factory pattern, Inversion of Control and Dependency Injection. Is it not possible to explain the similarity and differences of these terms in your own words?

  5. #25

    Default Re: Interfaces in Object Oriented Programming

    HAHAHAHA! aligriha pud ninyo diri oist!

    bai yanong_banikanhon, simple na kaayo na pagka-explain ni canobic. unsa pa man diay gusto nimo nga explaination? if wala ka kasabot bai pangutana na lang kaysa magpaka-arun-ingon ka nga kabalo! kay kataw-anan kaayo ka paminawun bro! sama ana imo example ^^ ang tawag ana bai kay BUG! hahahaha!

    bai canobic tama na imo example bai agree ko ana. mao sad na amo gamit diri sa ako trabahuan ang spring dependency injection. tama bitaw Factory pattern sa wala pa ang IOC. karon naa na mga IOC and DI dili na kinahanglan mag Factory pattern and mas limpyo ang code.

  6. #26

    Default Re: Interfaces in Object Oriented Programming

    @jonasbelita

    Let's assume that I don't know. Pasabta kuno ko bro unsa ang similarity ug kalainan anang Factory pattern, Inversion of Control and Dependency Injection. Kay mora'g maski ang mga expats diri nga akong giinterview, mao ni ilang gipangsulat sa ilang resume. Unya kun pa-explainon na, di na man makatingog.

  7. #27

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by yanong_banikanhon View Post
    That is exactly my point. No developer would blindly (or intentionally) instantiate that class. So all the developers who are going to use your API will have to make it 100% sure that they instantiate the proper class. They need to know the details of the implementation classes. This makes their lives a little bit more difficult and effectively DEFEATS the purpose of using interface in the first place.

    Now going back to Factory pattern, Inversion of Control and Dependency Injection. Is it not possible to explain the similarity and differences of these terms in your own words?
    I see... I think this guy is associating himself with the user class. He thinks that if the user class doesn't know what the implementing class is then he as the developer dili pud siya makabalo!

    Maong galibug!

    bro @yanong_banikanhon developers hold the control. Mao gani ginatawag ug IOC or Inversion of Control because you remove the control from the user class and giving it to the framework such as Spring and to you as the developer. Gets na?

  8. #28

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by jonasbelita View Post
    HAHAHAHA! aligriha pud ninyo diri oist!

    bai yanong_banikanhon, simple na kaayo na pagka-explain ni canobic. unsa pa man diay gusto nimo nga explaination? if wala ka kasabot bai pangutana na lang kaysa magpaka-arun-ingon ka nga kabalo! kay kataw-anan kaayo ka paminawun bro! sama ana imo example ^^ ang tawag ana bai kay BUG! hahahaha!

    bai canobic tama na imo example bai agree ko ana. mao sad na amo gamit diri sa ako trabahuan ang spring dependency injection. tama bitaw Factory pattern sa wala pa ang IOC. karon naa na mga IOC and DI dili na kinahanglan mag Factory pattern and mas limpyo ang code.
    Tama bro @yanong_banikanhon. The explanation is already very simple. Ako mismo, I can't make it any simpler. It seems that you're the one who doesn't really understand only because you refuse to. Don't force the issue man.

  9. #29

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by maddox22 View Post
    I see... I think this guy is associating himself with the user class. He thinks that if the user class doesn't know what the implementing class is then he as the developer dili pud siya makabalo!

    Maong galibug!

    bro @yanong_banikanhon developers hold the control. Mao gani ginatawag ug IOC or Inversion of Control because you remove the control from the user class and giving it to the framework such as Spring and to you as the developer. Gets na?
    In a big team which is composed of smaller teams (may 4-10 people), it is not always the case that the guy who developed the class implementation is the same guy who will consume it. If you have two classes which implements a single interface but yet these classes have two opposite implementations, obviously the guy who is going to consume your classes should know the implementation details before he can safely instantiate them. THIS DEFEATS the purpose of an INTERFACE which basically means a contract the implementation classes should adhere to.

    Detonating Obama's desk and exploding Laden's bed are TWO DIFFERENT contracts. It just doesn't make any sense to put them into a single INTERFACE.

  10. #30

    Default Re: Interfaces in Object Oriented Programming

    Quote Originally Posted by maddox22 View Post
    Tama bro @yanong_banikanhon. The explanation is already very simple. Ako mismo, I can't make it any simpler. It seems that you're the one who doesn't really understand only because you refuse to. Don't force the issue man.
    Maybe it just me. But can you tell me asa ang post ni canobic that clearly explains the difference between Factory pattern, Inversion of Control and Dependency Injection so that I can read it again?

    All I can see are posts with some codes and terms such as Inversion of Control and Dependency Injection thrown in without any explanation unsa ang kalainan aning duha. Just in case you don't know, Inversion of Control != Dependency Injection.

  11.    Advertisement

Page 3 of 7 FirstFirst 123456 ... LastLast

Similar Threads

 
  1. Object Oriented Programming
    By poymode in forum Programming
    Replies: 31
    Last Post: 09-02-2011, 10:21 AM
  2. Your opinion regarding Josh Hartnett interview in ABC's program
    By epardz_azia in forum General Discussions
    Replies: 7
    Last Post: 03-24-2009, 10:20 PM
  3. 3 killed in Negros Oriental clash
    By radiostar in forum Politics & Current Events
    Replies: 7
    Last Post: 09-22-2008, 11:32 PM
  4. C/C++ i need help in making a program
    By mE_bytes in forum Programming
    Replies: 54
    Last Post: 07-30-2008, 05:41 PM
  5. Need help in Installing Java programs in my Samsung D880
    By Soj in forum Software & Games (Old)
    Replies: 0
    Last Post: 04-24-2008, 06:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top