[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Naming suggestion required

Srijayanth Sridhar

6/12/2009 7:19:00 AM

[Note: parts of this message were removed to make it a legal post.]

Hello,

I am writing a program that will fetch me lyrics from any one of a possible
number of sites. For this I have the following setup:

class AbstractLyricFooBarSomething(this is the name suggestion I require)
def init
@artist=""
@title=""
@lyric=""
end
attr_reader :lyric,:artist,:title
end

class MetroLyrics < FooBarSomething
def init url
#do magic
end
end

and so on. There'll be a factory that takes in the search queries and
returns an appropriate object(s)

What should I call FooBarSomething? I thought of the following and none of
them seemed to fit the paradigm.

Lyrics
LyricEngine
LyricsParser
Lyricalizer

Thank you,

Jayanth

3 Answers

Srijayanth Sridhar

6/12/2009 7:21:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

Umm, sorry, read init as initialize, too much Python happening on the side
;)

Jayanth

On Fri, Jun 12, 2009 at 12:48 PM, Srijayanth Sridhar
<srijayanth@gmail.com>wrote:

> Hello,
>
> I am writing a program that will fetch me lyrics from any one of a possible
> number of sites. For this I have the following setup:
>
> class AbstractLyricFooBarSomething(this is the name suggestion I require)
> def init
> @artist=""
> @title=""
> @lyric=""
> end
> attr_reader :lyric,:artist,:title
> end
>
> class MetroLyrics < FooBarSomething
> def init url
> #do magic
> end
> end
>
> and so on. There'll be a factory that takes in the search queries and
> returns an appropriate object(s)
>
> What should I call FooBarSomething? I thought of the following and none of
> them seemed to fit the paradigm.
>
> Lyrics
> LyricEngine
> LyricsParser
> Lyricalizer
>
> Thank you,
>
> Jayanth
>
>

Trans

6/12/2009 10:07:00 AM

0



On Jun 12, 3:18=A0am, Srijayanth Sridhar <srijaya...@gmail.com> wrote:
> Hello,
>
> I am writing a program that will fetch me lyrics from any one of a possib=
le
> number of sites. For this I have the following setup:
>
> class AbstractLyricFooBarSomething(this is the name suggestion I require)
> =A0 def init
> =A0 =A0 @artist=3D""
> =A0 =A0 @title=3D""
> =A0 =A0 @lyric=3D""
> =A0 end
> =A0 attr_reader :lyric,:artist,:title
> end
>
> class MetroLyrics < FooBarSomething
> =A0 def init url
> =A0 =A0 #do magic
> =A0 end
> end
>
> and so on. There'll be a factory that takes in the search queries and
> returns an appropriate object(s)
>
> What should I call FooBarSomething? I thought of the following and none o=
f
> them seemed to fit the paradigm.
>
> Lyrics
> LyricEngine
> LyricsParser
> Lyricalizer

Generally speaking go with just "Lyrics". But also have you wrapped
everything in a name space? Eg.

module LyricsLicker

class Lyrics
...
end

class MetroLyrics < Lyrics
...
end

end

T.

Srijayanth Sridhar

6/12/2009 10:12:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

>
> Generally speaking go with just "Lyrics". But also have you wrapped
> everything in a name space? Eg.
>
> module LyricsLicker
>
> class Lyrics
> ...
> end
>
> class MetroLyrics < Lyrics
> ...
> end
>
> end
>
> T.
>
>
Thanks for the suggestion. I will wrap it up in a namespace.

I actually dig LyricsLicker. Pretty cool.

Thanks,

Jayanth