It's hard to answer your question based on your description but, for me "it all depends..." such as whether you ever going to use that XML or not.. or i guess some other reasons..
For me, keep everything simple.. you create three folders (model, control, view) and start from there.. and just remember the concept of what each item should do... model (stores data, states.. ). and View is basically UI. and make sure there is NO direct communication between view & model. it all has to go through controllers..
I built couple of Enterprise flex applications.. to me most important thing is using a right design pattern and INTERFACE!!!! (not the UI, I meant like.. type)
hope this helps, but, sounds like you know more than I do...
just keep everything simple..
I am not able to uderstand from description provided by you
use Cairngorm frame work to implement MVC architecture
which is the best frame work recommended by adobe
if this post answers your question or helps. please mark as it such
If that's all your application will ever do then in my opinion, using MVC or any other pattern is just an overkill. Obviously, it's your decision to take but the application you have described is not of a complexity that would require the separation of the three logics ( especially if it will never change ). Patterns and meta-patterns like MVC come in handy when they bring something ( something good ) to the application and most importantly, something that is really needed. We could start abusing MVC ( and any other patterns ) to build a simple Hello World! application but does it really need it? In my opinion... No, it doesn't need it and nor does your application need it ( even if you go on and decide to try to separate things using MVC principles, it can't be called a "bad practice" just a more senseless one ).
With kind regards,
babo_ya, I'm all for keeping it simple. I think my project is doing OK so far as far as keeping data model and views separated. I don't follow your statement on "interface", sorry. Oh, and I'm sure I don't know more than you. I'm very new to Flex.
kkc_mca, I have heard of Cairngorm but wanted to keep this simple, without a lot of external references. Maybe I misunderstand its use and methodology, I'll take another look.
Barna, This is just a small part of the app. The initial release of the app will contain at least 15 different views, most of them dynamically generated (not MXML files) . The data it works with comes from a base of more than 40 tables and it's still growing. So, I want to get this right from the start.
1 person found this helpful
My Flex 3 Cookbook post on a simple example of MVC may help:
If this post answered your question or helped, please mark it as such.
Your Wizard MVC demo was what helped me get started on changing my project to MVC. It is a great resource. I'm just still trying to figure out a few points that haven't clicked for me yet.
What bobo meant by interface is: you should program to an interface and not an implementation. An "interface" can be an abstract class or an actual interface ( a class using the "interface" keyword ). If these things are not clear to you then you should spend some time reading up on OOP principles.
Once the key OOP principles are clear to you then you should step it up by reading up on Design Patterns. If you really want to get your application done correctly, then MVC is just a "minor part"... There should be more patterns involved that would help with decoupling and maybe reusability. For example, you could use the Observer pattern to achieve the desired communication between you logics. Also, you can use a Factory Method or the Abstract Factory pattern ( depending on the situation ) to create different objects/components and so on.
I don't know how much experience you have in programming but from your posts, I'm quite sure that you are totally new to design patterns. So, if you want to get things done, then forget about finding a question to "does this fit the MVC architecture", instead, try read up on more patterns, experiment a bit with more simple applications so that you'll actually understand why certain patterns are used, where to use them and how.
Just my 2 cents. Wishing you luck.
My 2 more cents.
Cairngorm is a piece of SXXX. It has Model & View & Controller... and stupid commands....
I talked trash to this guy from Adobe Steven WEbster? who claims that Caringorm is bad ***... and his Obserevalue is so bad.. the worse design pattern I ever seen.
I'm so pissed off because I used it on an Enterprised App. and the worse design pattern ever.
Cairgorm is definitely not the best framework out there but I wouldn't call it what you just did. It has it's purpose too. In my opinion, people should play around with such frameworks only after they already have some serious experience building applications with the help of design patterns from the ground up. Doing so, they surely have the knowledge to easily switch to whatever framework, that in the end might help speed up development time.
But again, if you really want to learn and get things done the way you want, then you should build the whole think from the ground up without limiting yourself and the application to the things a certain framework can offer. Some frameworks are easier to extend and can be added these additional "features" but then what's the point in using the framework if you are altering it anyway?
So, if you want to get it right and especially learn while working, then read up / learn design patterns from the ground up. You will only be successful if you actually understand what's going on in your applications and more importantly, you know why things are working the way they are ( you'll have to learn to take design decision that on the long run will help you become a better developer ).
Thanks for the additional input.
Barna Biro, You are correct - I have no experience with Design Patterns. Is there a book or online resource you would recommend for learning the formalities and standard methods of OOP and the patterns and methods you mentioned?
I have learned a lot on my own, and can make just about anything work... but there are times when a broader knowledge base would be beneficial. I'm always looking to learn more.
this is my favor one. You have to fully understand what "Interface" is and how to use it before you read this.
And I think the author should change this book title to "how to use interface to create design patterns".
I can only recommend the books I have read:
The Heads First book might not be for everyone's taste but it's a good book non the less ( a really good intro to OOP and Design Patterns ). The Gang of Four book is "the Design Patterns Bible" but it also should be the last book you read ( the terms used in the book might seem overwhelming for a beginner so you should definitely leave it as last ).
Don't be discouraged if you feel that you are not getting any of the things corevered in the book after reading it for the first time. If you need, read the book over and over again and most importantly EXPERIMENT! You should definitely understand why patterns are useful and when to use certain patterns ( not everything should be over-complicated with patterns if these patterns don't bring "a plus" to the application ).
Wishing you luck,
Thank you for the book suggestions. I'll take a look at them.