should I use a framework?
Hi Guys
I'm making a multi player browser game. The game will have some forms to setup data into the database and the player will be able to check other players data.
I will load the players data from the DB into a Bean when the application starts and then just get the other players information from DB when and if asked.
I'm planing on doing it as MVC2 using JSP, JSTL, SERVLETs, BEANs
Would you recommend me to use Struts for example? should I just use it without any framework?
I read a lot about Struts and can't really see what it can bring to an application like mine. I can use the i18n easily with JSTL and for few validation of forms I don't know if it's worth it.
What do you think? (-:
Thanks in advance
(-:
if you're asking someone elses advice on whether to use a framework, then don't bother using one. that's not me being an aloof @sshole, btw, just an observation: if you can accomplish what you want to without it, then do so. don't just use one for the sake of using one
Thanks for the answerI'm asking for the right approch!!! I can do it both ways, but what is considured to be the better one?
there isn't one. there really isn't. frameworks don't do anything you can't do yourself, they just ease the burden. people use them because it allows them to concentrate on their problem domain, rather than mucking about writing object-relational mappers or whatever
unless you can think of a good practical reason to use a framework, such as you don't have time to write the code from scratch, or don't have the skills to, or you specifically want to gain experience in using a particular framework (all valid reasons) I wouldn't bother
but seriously, there isn't a "right" approach to this. if you can do without a framework, then do so
> Hi Guys
>
> I'm making a multi player browser game. The game will
> have some forms to setup data into the database and
> the player will be able to check other players data.
But when player A makes a change, players B-Z won't be able to see that change until they make another update request. That's how HTTP works, right?
>
> I will load the players data from the DB into a Bean
> when the application starts and then just get the
> other players information from DB when and if asked.
>
> I'm planing on doing it as MVC2 using JSP, JSTL,
> SERVLETs, BEANs
OK.
> Would you recommend me to use Struts for example?
No.
> should I just use it without any framework?
No.
> I read a lot about Struts and can't really see what
> it can bring to an application like mine.
Struts is all about JSP, JSTL, SERVLETs, BEANs. What don't you see?
Struts is a Web framework. You're writing a Web app. What's the alternative - you winging it? (Good luck with that.)
> I can use
> the i18n easily with JSTL and for few validation of
> forms I don't know if it's worth it.
Struts is more than validation.
>
> What do you think? (-:
I think you have no idea of what you're doing.
%
PS - Struts is not the framework for you. Spring is.
thanks for the help georgemc (-:duffymo, thank you for your golden remarks. If you don't want to help, why waisting time on writing a reply. Does it make your ego bigger?wish everyone a great day (-:
Duh. You have no idea what you are doing. That's why you're asking the question - if you knew what you were doing you wouldn't need to ask the question.
Duffy gave you excellent advice - use the Spring framework. Georgemc gave you terrible advice. But Duffy didn't stroke your ego or tell you what you wanted to hear.
I agree with Duffy. And I think you're completely ignorant of what you're letting yourself in for if you try and wing it. But I'm a meanie, so I must be wrong, right?
Thank you dcminter for your reply
I'm here to get some advices from people that know more then me about this topic.
There are ways to tell and explain things and if you don't really want to help why bother?
There is nothing that I want to hear and don't want to hear!!! as long as it is in a positive way. You can tell me that I'm totally wrong and that's ok with me.
I don't think that duffymo really wanted to help (even if he is your friend)
Anyway, I thank you for your concern and wish you a great day (-:
I suggest you re-read Duffy's post more carefully.
I also suggest that if you're only open to advice given in a "positive way" that you're not going to learn much.
I disagree with you but I'll just saybe positive, life is great (-:Thanks
The assumption that grumpy people have nothing to teach you is, if anything, quite a pessimistic outlook on life.
Let me emphasize this again - there is positive information in Duffy's reply that is not contained in the replies of myself or the other poster. If you don't pick up on that it's your loss.
> Thank you dcminter for your reply
>
> I'm here to get some advices from people that know
> more then me about this topic.
That's what you got.
>
> There are ways to tell and explain things and if you
> don't really want to help why bother?
I wanted to help, and I think I did.
> There is nothing that I want to hear and don't want
> to hear!!! as long as it is in a positive way. You
> can tell me that I'm totally wrong and that's ok with
> me.
OK - You're totally, utterly wrong. You don't understand Struts well enough to make a rational decision on how useful it is.
> I don't think that duffymo really wanted to help
I did want to help.I just didn't tell you how brilliant you are by thinking that rolling your own would be better than using another framework written by people who know far more about development than you do.
> (even if he is your friend)
I like Dave just fine, but to be honest we've never met.
%
> The assumption that grumpy people have nothing to
> teach you is, if anything, quite a pessimistic
> outlook on life.
grumpy? 8)
> Let me emphasize this again - there is positive
> information in Duffy's reply that is not contained in
> the replies of myself or the other poster. If you
> don't pick up on that it's your loss.
Anyone going back and reading my reply won't find anything offensive - until they get to the line where I opine that the OP doesn't know what they're doing.
I think it's a valid conclusion to draw when a person who wants to write a Web app consisting of servlets, JSPs, Beans, and JDBC says that Struts doesn't apply and can't help them.
The OP strikes me as another product of that school of thought that says every kid gets prizes and nobody ever hears that they aren't above average. My advice? Get over it. We all have a lot to learn. Start studying. Go learn Spring and see why I suggested that you use its Web MVC framework:
http://www.springframework.org
%
Hi Guys
I just woke up to another sunny day. We are probably on another time zone.
I think that this was all a big misunderstanding. I never meant that I will build a new framework!!! I never said that I understand Struts so good.
I'm still trying to fix things in my head regarding MVC and frameworks.
Maybe you understood from my post that I think that I'm soo good and can do everything better, that's not what I meant (-: maybe I wrote it wrong (I can always blame my English (-: ).
what I was wondering was, if I should just use the RequestDispacher to call the right servlet, then this servlet will call a model that will validate and then to models that will do the actions. Every form will have its own Servlet to call. I know that I hard-code the sevlet name in my Jsp page but if I need to change something I just change it in the Jsp instead of going to find it in the configuration file. Is this sooo bad?
If the application is very big and is build by many developers, then I understand the problem in hard-coding it and importance of the configuration files. But for an application like mien?
I think that this is my main confusion, and that what I asked in my original post (at least that what I meant). (-:
I'm always learning (-: I enjoy it.
Thanks for your advices I appreciate them.
Wish you a great day (-:
Dror
ok, what was terrible about my advice? constructive criticism please! OP, listen to these guys, they seem to know more than me...
> Hi Guys
>
> I just woke up to another sunny day. We are probably
> on another time zone.
>
> I think that this was all a big misunderstanding. I
> never meant that I will build a new framework!!! I
> never said that I understand Struts so good.
> I'm still trying to fix things in my head regarding
> MVC and frameworks.
Very good.
> Maybe you understood from my post that I think that
> I'm soo good and can do everything better, that's not
> what I meant (-: maybe I wrote it wrong (I can always
> blame my English (-: ).
>
> what I was wondering was, if I should just use the
> RequestDispacher to call the right servlet, then this
> servlet will call a model that will validate and then
> to models that will do the actions. Every form will
> have its own Servlet to call.
That's one way to do it.
Struts will have you write one servlet, called the front controller. All the JSPs make requests here. The front controller figures out which Action to call and routes the request there.
> I know that I hard-code
> the sevlet name in my Jsp page but if I need to
> change something I just change it in the Jsp instead
> of going to find it in the configuration file. Is
> this sooo bad?
It can be if the application gets big.
> If the application is very big and is build by many
> developers, then I understand the problem in
> hard-coding it and importance of the configuration
> files. But for an application like mien?
How do you know how big your app is today? Or tomorrow?
> I think that this is my main confusion, and that what
> I asked in my original post (at least that what I
> meant). (-:
This is the phrase that's problematic:
"I read a lot about Struts and can't really see what it can bring to an application like mine. I can use the i18n easily with JSTL and for few validation of forms I don't know if it's worth it."
The point being that Struts is far more than I18N and validation. It suggests a lack of understanding of Struts. Your English was fine.
> I'm always learning (-: I enjoy it.
As am I.
> Thanks for your advices I appreciate them.
> Wish you a great day (-:
> Dror
Look into Spring, even if your app is small and you can roll your own. Your future apps will benefit.
%
> ok, what was terrible about my advice? constructive
> criticism please! OP, listen to these guys, they seem
> to know more than me...
Ok, maybe terrible was an exaggeration. But I do think it was bad advice.
Your advice is the "Not Invented Here" syndrome writ large - essentially the mindset that "writing it yourself is just as good, if not better, than using someone else's code" as a default position only to be won over if someone can prove that the other guy's code is superior.
The problem with this attitude is that code which is being worked on and used by multiple people tends to have fewer bugs, and when it does have bugs, they tend to be better understood. Furthermore, if you are writing code that does some bit of house-keeping trivia, you are wasting time that could be spent building a better application.
So you should be using a framework unless there is a specific reason not to. The question is therefore which framework to use. The application proposed by the OP will require the following:
• Database support
• Web support - his preference is for MVC2
Spring will answer both requirements.
Note that I am not suggesting that it is impossible to build all of this using JDBC, JSP, Servlets, and not much more - but it would be desperately inefficient, probably horribly buggy, and a nightmare to maintain if it makes it that far. And that's assuming it's a small application.
Now, the only reason not to use a framework is if he is not yet knowledgeable enough about the basic components that he plans to use (JSP, Servlets, etc.) to understand their application within a framework - but that's his call.
Duffy said: We all have a lot to learn.Boy is that true. And the field's expanding faster than my capacity to catch up...
fair points. thanksso everyone's raving about Spring. must be something in it. I take it you use it a fair bit. am I right in thinking it can run standalone or within an application server? sorry, wandering slightly off-topic here
Which is why Sun should have a volunteer levelled tutoring program maintained by the community.Sorry to be off-topic.
> fair points. thanks
>
> so everyone's raving about Spring. must be something in it.
10,000 Elvis fans can't be wrong. 8)
Worth looking into, indeed.
> I take it you use it a fair bit. am I right in
> thinking it can run standalone or within an
> application server? sorry, wandering slightly
> off-topic here
Standalone or within an app server - Spring goes both ways.
%
> Which is why Sun should have a volunteer levelled
> tutoring program maintained by the community.
Huh? You want volunteers to tutor you above and beyond what's done in this forum? Do I understand you correctly?
Who's going to volunteer to prepare materials and set standards on that?
It seems like it's too much to ask, IMO.
> Sorry to be off-topic.
Off-base, in my opinion.
%
Yes, off-base it is (were you referring to my post as a whole or my apology?) Yet I feel inspired to respond now.
I conveyed the wrong idea. I always had it in my mind that it would be a mutual tutoring program. People would ask to be taught in a certain area and say what they are willing to teach others in. Instead of paying a teacher with money, you are paying a teacher with knowledge.
> Who's going to volunteer to prepare materials and set standards on that?
The person requesting the tutorial would be expected to already have access to the necessary materials. The tutoring would be through online communications. The person giving the tutorial could always ditch it midway through as long as he or she is not "paying with knowledge" for a tutorial that they received.
I understand that this is nowhere to post an idea like this. I just wanted to clarify what I had in mind and what I miscommunicated.
> Yes, off-base it is (were you referring to my post as
> a whole or my apology?)
Your idea. I never discourage anyone from apologizing.
> Yet I feel inspired to respond now.
Let's see how you do.
> I conveyed the wrong idea. I always had it in my mind
> that it would be a mutual tutoring program.
How is that different from what you see here? Aren't you being taught?
> People
> would ask to be taught in a certain area and say what
> they are willing to teach others in. Instead of
> paying a teacher with money, you are paying a teacher
> with knowledge.
You have to make it a fair exchange first. For most of the people who come here, it's not. They have little or nothing to offer when it comes to Java. So how does that work?
> The person requesting the tutorial would be expected
> to already have access to the necessary materials.
> The tutoring would be through online communications.
> The person giving the tutorial could always ditch it
> midway through as long as he or she is not "paying
> with knowledge" for a tutorial that they received.
>
> I understand that this is nowhere to post an idea
> like this. I just wanted to clarify what I had in
> mind and what I miscommunicated.
I don't see how it can work. The great thing about money is that we can agree on its value before the transaction starts. Who decides when the exchange of knowledge is fair and equal?
Besides, there are better ways to do something more intensive than asking discrete questions here, and they've been around for a long time: books, classes, finding on-line tutorials on your own, sitting down and writing a lot of code.
%
> How is that different from what you see here? Aren't you being taught?Very good point. You've won me over -- I completely agree.