Why Model-View-Controller?

Why Model-View-Controller?

Post by Ian Boy » Fri, 12 Oct 2007 03:59:14


In the "old" paradigm: if i had a Delete button on a form, that deletes a
row from a listview i would write

procedure TForm1.bbDelete(Sender: TObject);
begin
if Assigned(lvCustomer.Selected) then
lvCustomers.Selected.Delete;
end;

and be done with it.


In the MVC paradigm, i would write:

procedure TForm1.bbDelete(Sender: TObject);
begin
FCustomersController.DeleteSelectedCustomer;
end;

procedure TCustomersController.DeletedSelectedCustomer;
var
Item: TListItem;
begin
Item := FView.GetSelectedCustomerItem;

if Assigned(Item) then
FView.DeletedCustomerItem(Item);
end;

procedure TForm1.GetSelectedCustomerItem;
begin
Result := lvCustomers.Selected;
end;

procedure TForm1.DeletedCustomerItem(Item: TListItem);
begin
Item.Delete;
end;



Why am i making triple the work for myself?



--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by edbore » Fri, 12 Oct 2007 04:53:18


<snip>

Because you're paid by the hour?

EdB



--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.

 
 
 

Why Model-View-Controller?

Post by Bo Dea » Fri, 12 Oct 2007 05:20:22

In article <470d2102$ XXXX@XXXXX.COM >,



<snip something that doesn't sacrifice a chicken>

Have you given an acolyte of the most honorable helmsthingy thine
tribute?

--
-David

Quis custodiet custodes ipsos?

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Rudy Velth » Fri, 12 Oct 2007 06:09:09


LOL!

--
Rudy Velthuis http://www.yqcomputer.com/

"Quote me as saying I was mis-quoted."
-- Groucho Marx

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Michael Wa » Fri, 12 Oct 2007 13:55:12


Because you're too kind to chickens.

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Strong Bo » Fri, 12 Oct 2007 17:20:43


Because you haven't choked your chicken yet ?

--
Strong Bo

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Strong Bo » Fri, 12 Oct 2007 17:21:15


:-)

--
Strong Bo

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Rudy Velth » Fri, 12 Oct 2007 19:29:50


Ian, the multiple reference to chickens here might confuse you. It is
cutsomary that you must sacrifice at least one chicken before you will
get a meaningful answer to a technical question in this group (it is
called b.p.off-topic, after all).

You could either sacrifice that chicken, or you could navigate to
borland.public.delphi.oodesign and ask there. <g>


--
Rudy Velthuis http://www.yqcomputer.com/

"Human history becomes more and more a race between education
and catastrophe." -- H. G. Wells (1866-1946)

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by » Fri, 12 Oct 2007 19:35:38

what's this about confused chickens?



--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Ian Boy » Fri, 12 Oct 2007 22:53:59

> Ian, the multiple reference to chickens here might confuse you. It is

i hope the MVC software architecture never becomes accepted enough to
warrant posting in any "on-topic" borland group. i certainly don't want to
sully oodesign with MVC architecture.

It is off-topic, and i hope it says that way.


/me sacrifices a chicken. Cluck-uckk!



--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Rudy Velth » Sat, 13 Oct 2007 01:24:37


Why not? It is very on-topic there.

Too late. MVC is/was already the main architecture of systems like
Smalltalk, OWL (for Borland C++ and for ), etc.


--
Rudy Velthuis http://www.yqcomputer.com/

"Don't sweat the petty things, just pet the sweaty things."

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Ian Boy » Sat, 13 Oct 2007 03:21:50

> Too late. MVC is/was already the main architecture of systems like

/me shakes fist. Curse you Xerox PARC. Curse you!



--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Rudy Velth » Sat, 13 Oct 2007 03:27:46


I actually like Smalltalk.
--
Rudy Velthuis http://www.yqcomputer.com/

"I'd give my right arm to be ambidextrous." -- Brian Kernighan

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Ian Boy » Thu, 18 Oct 2007 03:08:06

> I actually like Smalltalk.


Java, the best argument for Smalltalk since C++. (Frank Winkler)

Java: the elegant simplicity of C++ and the blazing speed of Smalltalk. (Jan
Steinman)




--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.
 
 
 

Why Model-View-Controller?

Post by Rudy Velth » Thu, 18 Oct 2007 05:17:18


I had both in my quotes collection already. <g>

In the meantime, current implementations of Smalltalk are
compiled/jitted, AFAIK. So are current implementations of Java.

--
Rudy Velthuis http://www.yqcomputer.com/

"Few things are harder to put up with than a good example."
- Mark Twain (1835-1910)

--
borland.public.off-topic exists as a runoff for unwanted posts in the
technical groups. Enforcement of rules is deliberately minimal but
Borland reserves the right to cancel posts at any time, for any
reason, without notice.