best practices for cocoa touch static library [closed] - iphone

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm planning to do my next project using cocoa touch static library. My target is to separate my model entirely from my main project. ( so it does all the data communication between server and provide data to my main project). so that I can reuse the library in future if there's any iphone version.
I want my framework to behave like ios standard frameworks so that no one else using my framework should not be able to play with framework and misuse it. Specially they should not be able to override data which is given by my framework and do any kind of data manipulation.(protecting encapsulation)
I want to know that are the best practises of writing a this kind of static library?

From a language perspective you will want to carefully consider what is public method/member and what is private.
For all things private move them into the interface declaration inside your .m file:
#interface MyClass()
# Variables and Messages declared here are private.
#end
Then make a single header file which is exposed to your users with all public messages and properties.
When you do this be particularly careful that you document expectations of your users.
Nothing will break encapsulation faster than expecting a capability / variable and not being able to see how to get it in the docs / header.

Please refer what is said in the below links, this helped me design a better library.
Component-based Development Process
Software Component Specification
Using Design by Contract

Related

Is it easy for a PHP Developer to create own framework? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to create a website similar like imdb.com. Whether imdb.com uses any framework? if so which framework it uses? Otherwise are they developing on their own? Is it easy for a normal PHP developer to create my own php framework?
As a PHP developer:
I have my own php framework, So you can say it's not so hard; But you must first learn how other frameworks work... And decide what your framework need to do... Which design patters you agree with...
Most of big websites didn't use famous frameworks, Or even their own frameworks... Mostly using a plenty of libraries... Because when you use a framework you code faster but you waste resources as RAM, CPU IO/Disk...
A well programmed application is this one that use 100% of its code source, It's good to go OOP, MVC... But not in the way most of frameworks works... This what is life less working time cause a less quality project.
There are two reasons why you would want to create your own framework:
Learning purposes, it's a great learning opportunity because you
will learn a lot.
This one I highly doubt is a issue for you, but
If you believe your framework can be different and better in some
way than those already existing, go for it.
A framework isn't the application, a framework is a tool set that lets you get straight on the application itself, instead of writing a database abstraction layer you learn how built-in in works and writes the busniess logic your application needs.
Developing a new framework is not a trivial or easy work at all. Even for a team is difficult to handle, so be extremely sure you need to create yet another one before starting.
Instead, use open source, well known solutions, so that bugs are likely to be triaged and fixed. There are many which are available even for commercial use. Just choose your favourite one: Symfony, Code Igniter or Kohana or whatever and start building your application on top.
As of IMDB, probably they are using a framework, but there is no way to tell what if any.

Using Singleton Class [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have made use of a delegates in the past to share information about an Object (with it's associated properties) across different classes, but I'm planning a new App and thinking of using a Singleton Class to do this.
Is it mandatory protocol to use delegates to share information between classes, or can I simply employ a Singleton Class ?
Looking forward to some views or good advise on the topic.
You may be missing the basic point of Model-View-Controller, which is the primary pattern of Cocoa apps. Under MVC, there is no reason to "share information across…Tableview Controllers." There is a model layer. The model layer hold all the data. The view layer (including tableviews) reads the model layer and displays it. Views objects don't need to talk to each other very much. They mostly update the model and then read from the model.
You can implement the model as a singleton, or as an object that is passed into the view controllers when they are initialized. Both approaches have advantages. But there's no need for your view controllers to talk to each other in any case.
There are a lot of ways to share information between controllers. It solely depends upon your design what you opt to choose. Usually singletons are used to store information globally to be used by whole app anywhere. For example, to store game's score and its another stuff. Delegate is used to communicate between limited number of controllers. BTW you can broadcast your data to all "listening" controllers via Notifications. So again it really depends upon your design that what should you choose.
You do have several options. Core data, singleton, some sort of shared memory (maybe your pointer is in the Navigation Controller so you can share it with multiple screens -- or maybe in your AppDelegate), delegates, etc.

If you read an LGPL projects source code and that inspires an entirely different implementation, is that work still a derived work? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I really want to use PGM for an application that I'm working on for one my companies. That application will never be distributed, it's for internal use only. There is an implementation called OpenPGM and a (I believe) derivative work javapgm that implements the protocol. Both are licensed under the LGPL.
My question is if I read the source code for these libraries and use that knowledge to help create an Erlang PGM implementation, would that be considered a derived work? I would prefer to release my implementation under the BSD license, so I'm not trying to take something for nothing, but I want to play fair.
In short then:
Would / should my version be released under the LGPL?
If my company is using it internally only, would there be any restrictions on how it could use that library? (it would never be distributed outside the company).
Is it in the spirit of the LGPL license to do what I want to do?
Thanks in advance! :)
I don't think it would be a derived work unless there is a 1:1 correlation between lines of code in your thing and the open source code. We're not talking about a patent here, where the concept of the invention is important.
If it is only used internally then it doesn't have to be.
You could never be certain that it doesn't accidentally leak out or get shared or included in another project.
You should try to work with OpenPGM to make the Erlang interface that you need; then it is open source, other people may help maintain it for you, you get a free code review

what constitutes the name Kit? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm a bit confused with the "kit" thing.
I'm a .Net guy moving toward linux and iPhone dev. I'm wondering if Kits are simply something like a dll you reference? or is it when you have a complete framework consisting of many parts?
can I call NUnit "TestKit"?
What "kits" are you referring to?
Things like WebKit (open source web page rendering engine spearheaded by Apple), UIKit (User Interface framework for iPhone development), and TuneKit (framework for building iTunes LP content) are all marketing terms used by Apple for various collections of technologies and tools.
from http://en.wiktionary.org/wiki/kit "A set of related parts, tools, clothing or other equipment, collected for some specific purpose."
A set of development tools or libraries can be called a kit. An SDK is a kit.
WebKit is a content engine, so it's not really a kit.
NUnit is a test framework, not a kit. If you ship it together with a Mocking framework you can call those together a kit. A software bundle is often also called a stack. They call LAMP a stack, not a kit.
Kit has no set meaning in Cocoa, it's kind of a suffix for frameworks that Apple likes to use. It has a bit of a connotation of being a compact, elegant, high level way to build whatever it lets you build. Occasionally it's used to distinguish a UI portion of a framework from a non-UI portion, which might have a framework starting in Core. Core is similarly mostly meaningless, but with hints of being more low level or non-UI. On the desktop Core at one point meant "shared between Cocoa and Carbon".
There is a TestKit framework! To me, the intended connotations of calling your framework
"TestKit" are as above. You intend this to be a compact, elegant way to do testing. You will not throw the kitchen sink at the problem, you will endeavor to find a way to solve all the problems people want solved in a minimal way.

Plugin Driven Design Technique needed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
A project that a group of mine is starting is going to be focused around the use of plug-ins which are extremely specific to the user. We are trying to essentially create an application that without the plug-ins is nothing more then a running environment, and hence will be driven by the addition of the user-specific plugins.
I am not too experienced in this area of designing the application around plug-ins. How should I go about this process of creating a basic, essentially abstract application, and then creating these "dynamic" user-specific plugins to be used by the application?
As 'hobbs' pointed out, knowing the language would be beneficial to getting a better answer!
But regardless, I'll give you details on the Command Design Pattern which is frequently used in Java or any other object oriented languages.
See Command Design Pattern - Wikipedia and
Command Design Pattern - Java Tip 68 (for implementation details)
I use this pattern frequently when I know I will want to run 'plugins' in a generic manner (sometimes when I don't have all the details at that point in time). With more specs and/or security constrains you would want to alter this pattern respective of such constraints and include sandbox limitations, etc. That is all up to you!
Your client would begin by writing plugins using the interface you provide them (see links above). With a compiled class, your clients would then be able to drop their plugins into a folder for example.
When your application is ready to run the plugins, you would load a list of plugin candidates (either an xml file or scan the class files within a specific directory) and load each class in order to execute them one by one.
You can decide if you want to run these plugins in a specific sequence or in parallel (threaded design).
Note that if your plugins must access a specific state or API, you can provide it as a parameter to your plugin.
All of this works beautifully and I'm sure it can easily be adapted to fit almost any language.
Good luck,
Jeach!