What pattern use? How to use these patterns in Delphi XE 3? Developing new

My firwst post here, and i REALLY need yours help... 

My main objective is to create a _*standard system to register products, clients, sell items, control stock*_, and so on.

I want to use *Multi Tier, using Datasnap*, I dont want the classic client-server systems. There are several considerations I would like to discuss:

1 - I really want to do a *GOOD system, using patters* to make easier maintenance. I have read about MVC, saw some examples, but I read examples using Interfaces, and other posts in internet say Interfaces are bad. *MVC is good for this kind of system*?

2 - I want to separate my system, *I DONT want to use database related things* (save, update, delete) in the form, I am thinking in this kind of structure:

TProductModel = Class
    FDescription: string;
    FPrice: double;

    public
         Properties....
end;

TProductDao = Class
    public
         function Save(pProductModel: TProductModel): boolean; // Gonna save the information to database...
    end;

TProductForm = TForm
..
..
..
procedure   btnok_Click();
var
  oProductDao: TProductDao;
  oProductModel: TProductModel;
begin
    oProductDao := TProductDao.Create;
    oProductModel := TProductModel;

    oProductModel.Description := 'Product number 1';
    oProductModel.Price = 99.99;

    oProductDao.Save(oProductModel);
end;


* What could you suggest to me about this kind of things, what could I Do? *

3 - _*May I use TClientDataSet with good patterns like MVC?*_ How could I Implement the database commands using good patterns? in my "Controller" classes... 


Observation: I want to make a easy maintenance system, I dont need to use PURE MVC, i would like to make some simple code, with good maintenance in future. I would love to have a donk view interface, I would like to put all my code in a class between Server and User, but how _*Can I enjoy all RAD power provided by Delphi XE3,*_ and still using patterns?





--
Manoel Ribeiro from Santa Catarina - Brazil.
0
manoel
2/25/2013 2:27:33 AM
embarcadero.delphi.oodesign 456 articles. 0 followers. Follow

5 Replies
836 Views

Similar Articles

[PageSpeed] 51

I hate to say this, Manoel, but you're trying to re-create the client'server scheme by -- um, not using the obvious scheme.
If you have an idea HOW to do what you want, you may make a zillion cruzeiros.  Otherwise, you'd be better off using the well-tested and well-understood client-server relational DB pattern.

-- 
Ol' Tred
0
John
2/25/2013 4:01:14 AM
> {quote:title=John Treder wrote:}{quote}
> I hate to say this, Manoel, but you're trying to re-create the client'server scheme by -- um, not using the obvious scheme.
> If you have an idea HOW to do what you want, you may make a zillion cruzeiros.  Otherwise, you'd be better off using the well-tested and well-understood client-server relational DB pattern.
> 
> -- 
> Ol' Tred


ok, i do not want to use client-server, how do I implement MVC in Delphi XE3, WITHOUT interfaces, or interfaces is the right way?

--
Manoel Ribeiro from Santa Catarina - Brazil.
0
manoel
2/25/2013 12:40:33 PM
> {quote:title=manoel ribeiro wrote:}{quote}
> 
> ok, i do not want to use client-server, how do I implement MVC in Delphi XE3, WITHOUT interfaces, or interfaces is the right way?

Use the visual tools in Delphi the way they were intended. Use the datasnap or other remote library componets as they were designed.

Don't reinvent the wheel. You're creating a business application not an MVC framework product. You want to get your product to market as quickly as possible.
0
Rich
2/25/2013 5:55:33 PM
manoel ribeiro wrote:

> 
> ok, i do not want to use client-server, how do I implement MVC in Delphi XE3, WITHOUT interfaces, or interfaces is the right way?

MVC and client-server are two different concepts.  Although Delphi has all the tools necessary to write and apply an MVC framework, it isn't built in.
As _Rich says, you're better off to use Delphi's tools directly to get an application out to the customer.
I would advise, however, writing "business" classes to handle the business aspects of your application, and keeping as much non-user-interface code as possible out of the forms.
I think there are commercial MVC frameworks that work with Delphi, but I haven't used any myself.

-- 
Tredmill
0
John
2/25/2013 6:07:55 PM
> {quote:title=John Treder wrote:}{quote}
> manoel ribeiro wrote:
> 
> > 
> > ok, i do not want to use client-server, how do I implement MVC in Delphi XE3, WITHOUT interfaces, or interfaces is the right way?
> 
> MVC and client-server are two different concepts.  Although Delphi has all the tools necessary to write and apply an MVC framework, it isn't built in.
> As _Rich says, you're better off to use Delphi's tools directly to get an application out to the customer.
> I would advise, however, writing "business" classes to handle the business aspects of your application, and keeping as much non-user-interface code as possible out of the forms.
> I think there are commercial MVC frameworks that work with Delphi, but I haven't used any myself.
> 
> -- 
> Tredmill


OK guys i guess i understood it. 

Well I really know how to work client-server, I want to make diference, there are several programs like the one I want to create in Brazil, but i will do it Better!!!

I Guess I will use Factory DAO (I use it in my actual work) to create objects.

I will remember how to use DataSet´s (I use direct SQL commands actually). And lets see what happens.

Thanks for the answers.

--
Manoel Ribeiro from Santa Catarina - Brazil.
0
manoel
2/25/2013 6:36:08 PM
Reply:

Similar Artilces:

To use or not to use Delphi
Sadly, it seems to me that there is a sort of race between the two threads, for and against using Delphi in new projects, with more or less the same users posting in both threads. Arguments are fiercely debated in both camps. Borland had their own vision. As a community, now that Delphi has changed ownership I believe we should try to be more consistent, more clear, and more articulate in what we expect from Embercadero in terms of Delphi. We can contribute to keeping Delphi alive and moving in the right direction. "Laurent Cocea" schrieb: > Sadly, it seems to me that there ...

MOVED: Use Delphi XE TLB importer in Delphi 2007?
....to the ActiveX group: https://forums.embarcadero.com/thread.jspa?threadID=47170 -- Craig Stuntz · Vertex Systems Corp. · Columbus, OH Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/ ...

Trying to call a .DLL from Delphi XE (used to work with Delphi 6 :-) )
Hi everyone, I have a problem where perhaps some one could help point me in the right direction. In Delphi 6 I used a stand alone package to train a neural netowrk,. The trained neural network was stored as a .DEF file. The standalone software provided a .DLL and Delphi code to call the network and get the prediced values from your sw. (The .DLL was created in 2002 and apparently is 32 bit.) I have'nt used it for years but am now coming back to it.... I now use Delphi XE on Windows 7 (32 bit) The old .exe's I had compiled from that time work fine. However in Delphi XE ...

Top 3 Reasons NOT to use Delphi for New Projects
There are many reasons to continue with Delphi but then there are also many reasons for NOT continuing with Delphi esp. when starting new projects. Here are my Top 3 reasons 1. IDE is a pain in the A 2. VCL is stagnant and stale, like not compatible across different versions of compilers... 3. Delphi Pascal as implemented currently misses many features that are common in other programming languages. Let me give one single example from many that I can give. We are forced to declare each and every function, procedure before we can actually code that function or procedure. Th...

Is it possible to develop a custom Windows 7 shell using Delphi XE
Hello all! I am new to the forum, and as such I was unsure where to post this question, exactly. Anyway... I am currently doing research, trying to figure out if it would be at all possible to develop a custom Windows 7 shell using the Delphi XE2 language. I realize that there are several openSource applications out there that do this job quite well, but my roll is to determine if it is possible regardless. Any insight you guys can provide will be extremely helpful, and also any resources you might be able to point me towards would be even more appreciated. Thanks! > {quote:title...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

ANN: ICARUS 3.3
ANN: ICARUS 3.3 - Uses List Analyzer for Delphi ICARUS - USES LIST ANALYZER FOR DELPHI Find unnecessary units in Delphi uses lists ----------------------------------------------- Peganza Software has released version 3.3 of ICARUS - Uses List Analyzer for Delphi, a free Windows program that helps Delphi and Borland Pascal developers remove unnecessary units in uses lists. Removing unneeded units from the uses lists gives many benefits, including the following: - Unused code is not linked in. The Delphi linker removes unused code, but code in initialization and finalization ...

How design a COM using Delphi and Using in PB7?
I need some component, So, we want using DELPHI5 to develop a COM or Activex. What type of knowege or Skill I must know it. Can anyone tell us? from DRAOGN Can you explain what type of component you want to create? You may not need to a) build your own, or b) use Delphi. If the component should be used from within a PB application, you ought to use PB to develop it unless it is something that PB does not let you do. regards, Bill DRAGON wrote: > I need some component, So, we want using DELPHI5 to develop a COM or > Activex. > What type of knowege or Skill I ...

delphi Win32 using delphi .NET dll
Hi, I'm trying to use a delphi.NET dll in delphi.WIN32. I am currently using CodeGear Delphi 2007 with version2(base version) of .NET I can get the dll to import into the WIN32 application the only problem is when i include things such as: "using Classes,DateUtils, SysUtils" in the .NET dll the win32 application will instantly hang when any of the dll functions are called. Any help would be great thanks. Also I have tried this example and it also crashes for me? http://cc.embarcadero.com/Item/22688 -Braden I also found this.. "The problem is that, wehn you instal...

ANN: The free to use kbmMW 3.51.00 CodeGear Edition and kbmMemTable v. 7.00.01 Beta 1 CodeGear Edition for Delphi XE, has been released!
We are happy to announce the immediate availability of the free to use kbmMW v. 3.51.00 CodeGear Edition and kbmMemTable v. 7.00.01 CodeGear Edition for Delphi XE! The keywords for this release are: - Delphi XE support - Highly optimized performance in master/detail and ranges in kbmMemTable. - New GroupBy function in kbmMemTable. - Improved support for fielddefinitions with data, even in master/detail relations - Performance enhancements - Multithreading enhancements - Dataset enhancements - Stability enhancements and bugfixes Remember the free kbmMemTable CodeGear Edition ...

ANN: ICARUS 3.5.3
Find unnecessary units in Delphi uses lists Peganza Software has released version 3.5.3 of ICARUS, a free Windows program that helps Delphi developers remove unnecessary units in uses lists. Removing unneeded units from the uses lists gives many benefits, including the following: - Unused code is not linked in. The Delphi linker removes unused code, but code in initialization and finalization sections remains - Removes dependencies on other units, and makes the intent of your code clearer - Smaller executable modules (EXE, DLL, BPL) ICARUS can also tell which units that can...

ANN: ICARUS 3.3.1
ICARUS - USES LIST ANALYZER FOR DELPHI Find unnecessary units in Delphi uses lists ----------------------------------------------- Peganza Software has released version 3.3.1 of ICARUS - Uses List Analyzer for Delphi, a free Windows program that helps Delphi developers remove unnecessary units in uses lists. Removing unneeded units from the uses lists gives many benefits, including the following: - Unused code is not linked in. The Delphi linker removes unused code, but code in initialization and finalization sections remains - Removes dependencies on other units, and makes the ...

ANN: ICARUS 3.3.2
ICARUS - USES LIST ANALYZER FOR DELPHI Find unnecessary units in Delphi uses lists ----------------------------------------------- Peganza Software has released version 3.3.2 of ICARUS, a free Windows program that helps Delphi developers remove unnecessary units in uses lists. Removing unneeded units from the uses lists gives many benefits, including the following: - Unused code is not linked in. The Delphi linker removes unused code, but code in initialization and finalization sections remains - Removes dependencies on other units, and makes the intent of your code clearer ...

ANN: ICARUS 3.4.3
ICARUS - USES LIST ANALYZER FOR DELPHI Find unnecessary units in Delphi uses lists Peganza Software has released version 3.4.3 of ICARUS, a free Windows program that helps Delphi developers remove unnecessary units in uses lists. Removing unneeded units from the uses lists gives many benefits, including the following: - Unused code is not linked in. The Delphi linker removes unused code, but code in initialization and finalization sections remains - Removes dependencies on other units, and makes the intent of your code clearer - Smaller executable modules (EXE, DLL, BPL) ICAR...

Web resources about - What pattern use? How to use these patterns in Delphi XE 3? Developing new - embarcadero.delphi.oodesign

Developing country - Wikipedia, the free encyclopedia
Kofi Annan , former Secretary General of the United Nations, defined a developed country as follows. "A developed country is one that allows ...

Agile Software Development - Better ways of developing software
- All things cross-platform, mobile, and mobile-web. Especially Qt/QML related - I love developing software, but also practice managing projects ...

Tips For Developing Facebook Applications
There are many reasons for the immense popularity of Facebook, and one of these is the use of various applications . Most Facebook users have ...

Securely Developing on Mobile - Facebook
Facebook Security hat eine Notiz mit dem Titel Securely Developing on Mobile geschrieben. Du kannst den vollständigen Text hier lesen.

Simplifying Policies to Make Developing with Platform Better
Simplifying Policies to Make Developing with Platform Better

Tips for Developing a Successful Facebook App by Zachary Allia, Maker of “Free Gifts”
Thousands of Facebook apps have been developed so far, but only a few have skyrocketed into the user stratosphere like Free Gifts. Currently, ...

SWAT situation developing in Kirtland - KRQE News 13
Authorities in Kirtland, New Mexico say a SWAT situation has developed.

Search Twitter - developing
... because you are using an old version of Internet Explorer. Learn more here Search Refresh Dan Lyke @ danlyke 1m Three. Thousand. Years. Developing ...

If you're developing web apps, you're nuts if you aren't using Font Awesome. Seriously.
... a sauce. And they're fun! We're lucky because Font Awesome is such a great collection of icons. And it keeps getting better. If you're developing ...

Stanford’s ‘Developing iOS 8 Apps With Swift’ Class Now Available Through iTunes U
Pretty cool that something like this is available free of charge.

Resources last updated: 1/1/2016 8:13:29 AM