-3

I am starting to code an app in titanium. First I thought, when I saw some alloy xml tags, that it would be dead easy to write a small app.

but now, I am really stuck not knowing how to start at all. I have two killing questions in my head

Can I write an app ONLY using Alloy XML Framework or do i need to createSomeTag() always?

and

Why is there Alloy XML's there if there is possibility to create elements without xml - and vice versa.

I am totally new in this development philosophy

Bmo
  • 1,212
  • 11
  • 34
doniyor
  • 36,596
  • 57
  • 175
  • 260
  • 1
    The capability to create elements programmatically (in JS) and declaratively (in XML) is very common. Look at C#/XAML -- it's there too. Which solution you use depends on what problem you're facing. – Dawson Toth May 08 '14 at 16:30

1 Answers1

4

Can I write an app ONLY using Alloy XML Framework or do I need to createSomeTag() always?

Answer : Yes, you can write an app ONLY using Alloy Framework.

Check this link : Alloy Framework documentation

What do you mean by "do I need to createSomeTag() always" ?

Why is there Alloy XML's there if there is possibility to create elements without xml - and vice versa.

Answer : Alloy utilizes the model-view-controller (MVC) paradigm, which separates the application into three different components:

  • Models provide the business logic, containing the rules, data and state of the application.
  • Views provide the GUI components to the user, either presenting data or allowing the user to interact with the model data.
  • Controllers provide the glue between the model and view components in the form of application logic.
Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69
  • _"do I need to createSomeTag() always"_ : i read, that i can create e.g ```` element with controller code. but I would always go for alloy xml code because then i can concentrate on business logik then creating elements.. am i in right thought? – doniyor May 08 '14 at 13:05
  • 1
    The main advantage of Alloy is that it adapts MVC architecture as mentioned in the answer so it separates your ui and your application logic.So you need to create your tags in .xml file instead of .js file if you use alloy framework. But if you use "classic" view of titanium then you need to create your ui inside controller.js file. – Siddharth_Vyas May 08 '14 at 13:08