tag:blogger.com,1999:blog-27659513.post4801384221953079560..comments2023-12-31T23:44:24.149+02:00Comments on FCIH: OOP Design Concepts - InterfacesRamy Mahroushttp://www.blogger.com/profile/06875204608099539248noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-27659513.post-75091259414517637072013-08-26T07:59:16.119+02:002013-08-26T07:59:16.119+02:00Hi, Nice description about Interface in Oops conce...Hi, Nice description about Interface in Oops concepts.Thanks, its really helped me......<br /><br />-Aparna<br><a href="http://www.theosoftindia.com/" rel="nofollow">Theosoft</a>Anonymoushttps://www.blogger.com/profile/09701377984223022528noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-27669570900452415142012-08-24T08:14:01.735+02:002012-08-24T08:14:01.735+02:00very good article
thxvery good article<br />thxAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-27659513.post-80884414157075171082012-08-24T07:26:17.718+02:002012-08-24T07:26:17.718+02:00Hi this is great article...thanks so muchHi this is great article...thanks so muchSteve roberts : hurghadahttps://www.blogger.com/profile/01012071943821311297noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-47082654619165528782012-02-20T09:32:44.637+02:002012-02-20T09:32:44.637+02:00UserTxtFile and UserDB classes result into compile...UserTxtFile and UserDB classes result into compile time error because they are not implementing both the methods of interface... basics!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-27659513.post-2531286664424673832012-01-10T11:28:29.041+02:002012-01-10T11:28:29.041+02:00both this and the abstract class post were very he...both this and the abstract class post were very helpful, thanks very much for taking the time to write them.Frazhttps://www.blogger.com/profile/01193712946464265739noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-4907728999161532512010-09-28T09:48:08.341+03:002010-09-28T09:48:08.341+03:00suppose the main game logic has an if condition on...suppose the main game logic has an if condition on the type of objects it is dealing with, and the condition cares only about if this object can move or not. Using interfaces will make this condition possible in the easiest way;<br /><br />if( object instanceof Movable)<br />{<br />//Code here<br />}<br /><br />suppose we did not have interfaces, so we do not have a behavioral description for objects, so, the same code above which cares about the moving behavior will be written many many times for each object type<br /><br />if (object instanceof car)<br />{<br />//code here to handle logic related to the moving behavior<br />}<br /><br />if (object instanceof plane)<br />{<br />//the same code again<br />}<br /><br />even if you type a one condition using '||', every time you add a new type that can move, you will add the check in the condition.Youssef Mamdouhhttps://www.blogger.com/profile/04917580493499832141noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-53186876973662289942010-09-28T03:27:18.734+03:002010-09-28T03:27:18.734+03:00" a creative team member came with the idea t..." a creative team member came with the idea that we need to make the extra super weird car with no wheels and with the ability to turn to a frog to hide from enemies and many many extra features. If we are not using interfaces, the game logic will need to handle the motion of each car as if they are of different type in spite that logically they share the core common behavior."<br /><br />Sorry but I didn't understand the above line, Can someone please tell me how its difficult to write code without interface in above case? Code for both case(w/interface and w/o interface) would be helpful.Unknownhttps://www.blogger.com/profile/00403938802623931022noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-63296306782861187052010-08-16T09:37:17.908+02:002010-08-16T09:37:17.908+02:00Thanks
its very usefull and consolidated.Thanks <br /><br />its very usefull and consolidated.T S Pawanhttps://www.blogger.com/profile/08081203440090378817noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-84914494130021456542010-07-07T12:50:28.784+03:002010-07-07T12:50:28.784+03:00hi varun,
unless the class implementing the interf...hi varun,<br />unless the class implementing the interface is abstract it has to implement all the methods. The reason for this, is that abstract classes may not implement some methods and leave them to be implemented by a concrete class, but concrete classes need to implement all the methods.Youssef Mamdouhhttps://www.blogger.com/profile/04917580493499832141noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-66942606739275144972010-07-07T09:25:28.274+03:002010-07-07T09:25:28.274+03:00Hi my name is Varun. I just want to ask that wheth...Hi my name is Varun. I just want to ask that whether the class which is implementing the interface needs to define all its methods....<br />In example here class implementing interface doesnot define all its methods.Varunnoreply@blogger.comtag:blogger.com,1999:blog-27659513.post-83897194862174369982010-07-07T09:24:55.888+03:002010-07-07T09:24:55.888+03:00Hi my name is Varun. I just want to ask that wheth...Hi my name is Varun. I just want to ask that whether the class which is implementing the interface needs to define all its methods....<br />In example here class implementing interface doesnot define all its methods.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-27659513.post-23560819300951861212010-07-07T09:24:25.218+03:002010-07-07T09:24:25.218+03:00Hi my name is Varun. I just want to ask that wheth...Hi my name is Varun. I just want to ask that whether the class which is implementing the interface needs to define all its methods....<br />In example here class implementing interface doesnot define all its methods.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-27659513.post-50292161683830588332009-10-09T12:36:47.263+02:002009-10-09T12:36:47.263+02:00I will say, its really great explanation about int...I will say, its really great explanation about interfaces. Even i have been using them for long time but never understood the correct use of them. Thanks for these kind atriclesUnknownhttps://www.blogger.com/profile/17908683214601977672noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-68833421222738934892009-03-17T16:14:00.000+02:002009-03-17T16:14:00.000+02:00Very good article.There is one point that you made...Very good article.<BR/>There is one point that you made was obvious: alot of programmer just fancily use interface for multiple inheritance as a workaround. That causes a big frustrated code.<BR/>Good job!Unknownhttps://www.blogger.com/profile/01550943634321717108noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-31553797187575837852008-04-19T23:34:00.000+02:002008-04-19T23:34:00.000+02:00thanks shady for ur reply, it is exactly as shady ...thanks shady for ur reply, it is exactly as shady said, it is all about levels of abstraction, and another thing...suppose u have a player that has a car..the class of the player will have a member variable of type car (the interface type) and as long as the game continues he may buy a normal car or a weird one, at either cases, u know that when u want to move the player's car u will find a method named move no matter what implementation class supplied for the car..got me??, u know the general type, and u need anything more....<BR/>if we make another car it will extend the same hierarchy and providing the same behavior and the game logic will deal with it the same way as it deals with it as it deals with any other car...<BR/>if it is still spaghetti feel free to ask as much as u want.....thanksYoussef Mamdouhhttps://www.blogger.com/profile/04917580493499832141noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-59464127812639556772008-04-19T21:38:00.000+02:002008-04-19T21:38:00.000+02:00I'm not the author of this post, but I guess I can...I'm not the author of this post, but I guess I can reply here..<BR/><BR/>In that case, Samar, you'll use abstract classes to implement the common behavior..<BR/><BR/>That's on the most abstract level, you'll have your interface, below that in a bit less abstraction level you have your abstract classes which has the common behavior among your lowest level of abstraction (that's WierdCar for eg)..Shady M. Najibhttps://www.blogger.com/profile/15517845851043368287noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-6378601677341827022008-04-19T21:31:00.000+02:002008-04-19T21:31:00.000+02:00hey , its very nice work but i think i have kinda ...hey , its very nice work but i think i have kinda misunderstanding here . If interfaces are indicators to the behavior without concerning abt details how can it help in the example of the extra super wired car i mean i will have to implement the movement in each class thus if i have WiredCar class i will implement its way of movement ,<BR/>Car1 which move normally i will implement its way of movement <BR/>car2(assuming it share the same way of movement with car1 & have different behaviors than it)i will also have to implement its movement although its the same as car1 <BR/>how interfaces helped me here ???? by just saying <BR/>that i have a method movement that is shared by the classes<BR/>implements it ?????<BR/><BR/>sorry 4 the long comment <BR/><BR/>thnx in advanceUnknownhttps://www.blogger.com/profile/05885011458834856611noreply@blogger.comtag:blogger.com,1999:blog-27659513.post-53735434039594606792008-03-07T01:14:00.000+02:002008-03-07T01:14:00.000+02:00very nice discussion.sorry i have a question that ...very nice discussion.<BR/>sorry i have a question that may be out of your topic<BR/>i need to know what's the difference between interface and abstract class and when to use each of them?<BR/>thanks.solihttps://www.blogger.com/profile/03026749039429460696noreply@blogger.com