• Post Reply Bookmark Topic Watch Topic
  • New Topic

How/Where to Have Image URL?  RSS feed

 
Luminair Revhial
Greenhorn
Posts: 6
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, we could have an interface "Shape",
then classes "Circle" and "Square" implementing it with a random prntline method saying what shape it is.
Is that right for the MVC pattern?
And how would one go about on adding a url image link to the circle and square class? (trying servlets+html too)
Should I add "final String illustration" to "Shape" interface or put that in a new interface "isIllustratable" instead or neither?
 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luminair,

What about you tell us what you want to do?

There is an interface called Shape in Java.  If you want to implement that in your class, then you need to look over the interface and see what must be done.

As far as what you are asking--I just don't see what you are trying to get at, your words are too ambiguous and you don't say what you want to do: what is your objective?

Les
 
Luminair Revhial
Greenhorn
Posts: 6
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:Luminair,

What about you tell us what you want to do?

There is an interface called Shape in Java.  If you want to implement that in your class, then you need to look over the interface and see what must be done.

As far as what you are asking--I just don't see what you are trying to get at, your words are too ambiguous and you don't say what you want to do: what is your objective?

Les


I would like to make sure the code/notes from school is following standards(?)
Here's what we covered recently:
http://i.imgur.com/cpCJJBr.jpg
Is it right that the "Shape.java" we made is an interface rather than abstract class (it only has 1 method that overrides to a printline)?
And that if for example I add another to mix with "shape" and "color" like "picture", would I change "AbstractFactoryForShapeColor.java" to "AbstractFactoryForShapeColorPicture.java" then?
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very hard to answer your questions because they are broad and short on details.  Let's focus on one question and TellTheDetails (that's a link).
 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is an assignment you would have to ask your teacher or the answer that your teacher is looking for is in your notes or the assigned reading.

The way I look at abstract class vs interfaces is this:

Abstract Class: is a pattern that you want followed for all of your objects that are implemented, kind of the common base.

Interface is a common way of adding features to any class, but the classes themselves may be quite  diverse.

You can have a diverse bunch of objects like a Car, House, Dog, Sky, and Banana each of these can implment an interface for color that would print each object's color, that interface gives a common way to access the color of those objects, but obviously does not give a base for each of thsoe diverse objects.

 
Luminair Revhial
Greenhorn
Posts: 6
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:Since this is an assignment you would have to ask your teacher or the answer that your teacher is looking for is in your notes or the assigned reading.

The way I look at abstract class vs interfaces is this:

Abstract Class: is a pattern that you want followed for all of your objects that are implemented, kind of the common base.

Interface is a common way of adding features to any class, but the classes themselves may be quite  diverse.

You can have a diverse bunch of objects like a Car, House, Dog, Sky, and Banana each of these can implment an interface for color that would print each object's color, that interface gives a common way to access the color of those objects, but obviously does not give a base for each of thsoe diverse objects.



Thanks for this! Really, really, super duper helped clarify things up for me xD
*And turns out the prof really did a habit of doubtful coding just to apply a lesson (Shape should've been the base model abstract class in our case!)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!