Norma Caballero

Greenhorn
+ Follow
since Jan 30, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Norma Caballero

Hello
When I do an ant javadoc I get
[javadoc] javadoc: warning - Import not found: org.apache.commons.lang.StringEscapeUtils - ignoring!
Does anyone know how can this warning message be removed?
Thanks!
20 years ago
Hello everyone...
I have a question regardin retrieving information from a database. Ok, let's say I have a person object, which has name, age, address, gender, etc...So I have a case where I need to retrieve all the persons names, so what would be best? To retrieve a collection of person objects and then iterate through it to get the names, or to perform a query, construct a list of names and that's it?
I've been doing the first thing, gather a collection of objects and then in the business level, iterate through them and get the information I need. I don't have to go to the database when for example, a user clicks a persons name to see the other data for that person. But I don't know if this may be too expensive.
I guess I could figure out that if I am not going to use more information I could just retrieve what I need. But we always try to think in what if the system should be enhanced to support a new functionality.
What factors should be taken into account when making a decision of this kind?
Hi
I'm glad this is useful to you. But I dont understand your question very good. Could you be more specific?
20 years ago
Hi
I've been in those situations where you dont know exactly what action you need to call. What I do is that I have a javascript function like:

And on the onclick in each button you would call the DoAction method sending the action you want to execute as parameter.
This way you only have one function that submit all the actions you may need.
Good Luck!
20 years ago
Hello everyone,
I am relatively new to Struts, I've been working with it for about three months and I think it's great. But as the theme in this forum says, I would like to know what other frameworks are out there and where could I read about them. Just to have an idea. thanks! And have a nice day everyone!
Hi everyone
I know that maybe there is not too much people from Mexico in Javaranch, but there will be Tech Days in Mexico City...
20 years ago
Hi,
What we do in the project Im working on, is that we create a BaseAction for each module, this BaseAction has all the methods needed to perform the actions. And then we create an AddAction.java, DeleteAction.java and UpdateAction.java and we make calls to the methods created in BaseAction.java
I think it doesn't matter if two actions return to the same jsp, you can specify that in struts-config.xml in the forward name tag inside the action entry you specify.
Good luck!
20 years ago
Hi,
When I started in my first job I had no clues about design patterns and the application I was going to work in was developed using patterns in a very strict way. I started as a trainee, so what my project leader did was, he made me understand first the MVC architecture, because most of patterns are divided this way, also understand multi-tier applications. The I started reading the book "Core J2EE Patterns"and I was reviewing the code and the application. I also reviewed the sequence diagrams for the application, I found those very useful because you could visualize the layers of the applications.
As someone else said, you need someone who knows patterns to coach you. Once I got understanding of patterns, it changed completely how to think in applications.
Good Luck!!
Hi, regarding your first question I think the right way to go would be having a separate layer to retrieve the data.
And about your second question, I think code looks much more nicer and cleaner having an object that can create the grid. Also, it will look the same all the grids throughout your applicaction. I don't have too much experience with developing Custom Tags, only in using them But maybe you could create tags for your grid, I've seen people do that. Not only makes the code look cleaner, but it is easier to develop and to maintain.
Good luck
Thanks a lot!!!

What term would you use?
Hi, at the previous project I was working in we developed Model 2 MVC applications. Now, I joined a team using Struts and I was amazed at how it speeds up the development process.
Having the struts-config.xml eases things a lot. Also, on the JSPs, using the tags makes everything much easier and code looks a lot cleaner. I also like that you dont have to worry about controllers, handlers, dispatchers and such and that you forget mostly about setting and getting parameters directly from the request. You can focus on the business model.
It makes passing information much easier, because you know that the formbean has all the information you need.
On a very big application I was working on, we managed and used the Request object directly and it was very confusing, because we were a development team of 8, and sometimes I thought I was retrieving a parameter from the request, when I actually was retrieving a parameter that someone else had inserted.
If you have a good understanding of MVC, using Struts will not be hard.
Good luck!!!
Norma Caballero
20 years ago
Hello, I am sorry I didn't specified that or made clear that in my first post. Thanks for your answers.
So, applying an Integration tier would be a good option?
Hello
Maybe you could apply the ViewHelper pattern. This pattern aids in content retrieval and stores the model adapting it so the View can use it. Maybe this could help.
Model View Controller....
The View is very clear, the Controller is the one that tells where to go, fo example: which screen is next, or which action should be performed. the model performs these actions, I guess an understandable description for me is that the model represents your business. you would perform all business rules and validations here.


because sometimes I feel there are too many classes out there in our project.
Why do you feel this way? What would be your alternative?


Particullarly by the situation I described above that a model class encapsulates a database table and a collection of those objects is encapsulated in another class.
I don't know another way to solve it, this is the first time I've been using struts, though this has nothing to with using or not using struts, in my previous projects we used Javabeans to represent the model. And we used a business layer and DAO.
In this project we have the model classes and that's it, they are the ones executing the queries and business logic. Wouldn't it be better to apply an integration tier pattern such as DAO, to interact with the database?