Diego Macario

Greenhorn
+ Follow
since Jul 26, 2012
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Diego Macario

hey, do you have the same problem as me?

thanks
11 years ago
anyone wants to help me?
11 years ago
I have ended my job...now i want to know if its good

class exception





class input user



class model



class controler



class DAO



So i know this code is very extensive but if its good someone can use....

I didnt put menu and main class....

Say if something is wrong

Thanks
11 years ago
hi to everyone here
my doubt is about exception in java
i´ve learned to use exception in Java using try catch....throw and throws and creating my own class. But i dont know where e why and when to every these things Because i thought in one way but now i knew other way the way i knew was create a class, extends from exception and put a code like this

so i want a help from you....

thanks
11 years ago

Junilu Lacar wrote:In your case, the DAO is probably the best place for you to keep the data structure in which you will "persist" your objects. Declare the HashMap as a private member of your DAO class. Note that keeping them in memory is not really persisting the objects. Persistence means that you can get the objects back after you terminate the program and run it again. An in-memory solution is not true persistence.




hehehe, i know this...my teache told me...

i´ll make my code e later i post it

thanks a lot
11 years ago

Junilu Lacar wrote:What is this date and what is its relation to Telephone?



Sorry but i need to pratice more my english to show what i´m telling

Thats, i dont know where to put the hahsmap to work like a database...

Do you understand?

Junilu Lacar wrote:Your code actually looks pretty decent, not too bad for someone who only learned Java in the last 5 months. I've seen worse from supposedly more experienced programmers.



thanks 4 your words but i need to improve my code, i´m reading some books like refactoring, pragmatic programmer, how to program java, head first Java

but i get off my code and now i´m going to post all....

class model



class telephoneControler



DAO telephone class



class that interate with user

class IUTelephone




thats all i have, i didnt put my exception class to not full this page...

thanks
11 years ago

Junilu Lacar wrote:

Diego Macario wrote:
how can you help me?


By explaining some things to you, pointing you to material that you can read to get better understanding, and looking at your code to see if we have suggestions on how to make it better. Other than that, we won't do your work for you, but you probably already realize that.

As Jelle said, it would help if you explain a little bit more what your requirements are, why you think you need DAOs and Controllers, etc. It would also help if you showed us some of the code you have written so far, if any. Just code snippets, please -- don't post 500 lines of code, or even 100 lines. Thanks.



of course i know that you wont do my job and in this way i´m not going to learn

i´m going to put my class

package model - class telephone



package persistence - class telephoneDAO



package control - class telephonecontroler




My code have some methods in portuguese because i´m from Brazil....

But i have a doubt...where i put the collection to persiste de date because every time i make a new action i instance a new class and create a new object collection

My code have some erros, because i need to correct...

But i will correct this...

I did this...
11 years ago

Junilu Lacar wrote:DAO - responsible for persistence concerns

Controller - acts as an intermediary between View and Model/Business classes.




i forgot to say 2 things

i´m not using GUI and i´ve started to learn 5 months ago Java

my doubts are about

modeling classes

i need to make 3 DAO classes and 3 conttrolers

or its depends of the objective of my program

how can you help me?

thanks
11 years ago
Thanks for all answer

I will explain my problem

I´ve done this work for my college but i started to study so much Java to learn other ways to program

My problem is, i need to do a note that stores contacts, each contact have 0..* telephones

I always thinks, can i make my code more simple to understand and more separated...

I make a class model telephone who stores in a map or any collection of that...

and put the methods to add, alter, delete, show and find...

but i thinks its can be put in other class...

i saw i video in youtube and i have a little idea for DAO...

wich separate in 3 layers...


model who have only attributes and geters and setters of class

dao who intermediate vision class and controller class

controler who have methods to persisti in a class

i´m wrong?

thanks to all helping
11 years ago
hi, it´s my firts post and i´m started to learn Java

I have a job for my college that i´ve done but i want to learn a new way to separte the things....

i need to make a note with contatcs and telephones but i didn´t found a way to make it with DAO pattern

i want to know if someone can help me to learn and understand

because every example that i find in google is with database, but i will persist this in a collection....

sorry for my english...

thanks
11 years ago