Board index » jbuilder » Design pattern

Design pattern


2004-01-13 09:47:41 PM
jbuilder5
Is there a pattern to synchronize two tables? I have two JTables working on
two Models. How can I synchronize the two Models?
thanks
 
 

Re:Design pattern

Fabio Tirapelle wrote:
Quote
Is there a pattern to synchronize two tables? I have two JTables working
on two Models. How can I synchronize the two Models?

thanks
Could you be a tad more specific as to what you mean by synchronize the
table models?
 

Re:Design pattern

Ok.
I have two Model:
1) Object[][] rowscols, which contains the "AbstractModel" of my JTable
2) boolean[][] editable, which contains true or false. True when the cell
[n],[m] is editable, false when the cell [n],[m] in not editable.
The problem is the follow: when I add a new row, the rowcols will be
incremented to one row and I have to increment the editable object too. When
I delete a row, I have to decrement the rowcols object and the editable
object too.
"pNichols" < XXXX@XXXXX.COM >wrote in message
Quote
Fabio Tirapelle wrote:

>Is there a pattern to synchronize two tables? I have two JTables working
>on two Models. How can I synchronize the two Models?
>
>thanks

Could you be a tad more specific as to what you mean by synchronize the
table models?

 

{smallsort}

Re:Design pattern

"Fabio Tirapelle" < XXXX@XXXXX.COM >writes:
Quote
1) Object[][] rowscols, which contains the "AbstractModel" of my JTable
2) boolean[][] editable, which contains true or false. True when the cell
[n],[m] is editable, false when the cell [n],[m] in not editable.
The problem is the follow: when I add a new row, the rowcols will be
incremented to one row and I have to increment the editable object too. When
I delete a row, I have to decrement the rowcols object and the editable
object too.
Use ArrayList of array instead of array of array. Set a size for it
that is big enough.
 

Re:Design pattern

Hi;
I would like to realize a application two level (Client/Server) and I would
like to use the design pattern.
Question : Which have most important to use ?
regards;
 

Re:Design pattern

"dBoussebha" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
I would like to realize a application two level (Client/Server) and I
would
like to use the design pattern.
Question : Which have most important to use ?
There is no one pattern that is more important. Don't look to to fit
patterns into your design; a good design will use patterns without really
trying :-))
Joanna
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
 

Re:Design pattern

dBoussebha wrote:
Quote
I would like to realize a application two level (Client/Server) and I
would like to use the design pattern.
Question : Which have most important to use ?
Perhaps start off by thinking "MVC". Model - View - Controller. Separation
of logic, data, and UI is the theme you should always have in the back of
your mind. Design patterns are the tools that will help you achieve this
goal. Without a written specification, it's hard to know which specific
ones apply to your project. In the end, you'll probably end up using a
handful of patterns, and they are usually innertwined. They support one
common goal: To better organize your code. For everything you do, ask
yourself, "Will this easily adapt to changed requirements?" If the answer
is yes, then you have implemented well.